
on Sun Dec 28 2008, Arno Schödl <aschoedl-AT-think-cell.com> wrote:
I'm still having trouble understanding how you can implement a specialization for transform_iterator without knowing more than actually possible about the semantics of the transformation function.
Am I missing something?
namespace boost {
template< typename UnaryFunction, typename It, typename UnaryPred > transform_iterator<UnaryFunction, It> partition_point( transform_iterator<UnaryFunction, It> itBegin, transform_iterator<UnaryFunction, It> itEnd, UnaryPred pred ) { using boost::partition_point; return make_transform_iterator( partition_point( itBegin.base(), itEnd.base(), bind( pred, boost::bind( itBegin.functor(), _1 ) ) ), itBegin.functor() ); }
}; /* namespace */
OK, but for which iterator can we implement an optimized partition_point that works for arbitrary predicates? I thought the point of "specializing" partition_point was to be able to do something smart with iterators over sorted values (e.g. something like std::set iterators)
Or only have the default implementation in a separate library and implement the partition_point overloads in Boost.Iterator/Boost.MultiIndexContainer's iterator-specific header files, such as transform_iterator.hpp?
I'm getting confused, sorry.
You a) either implement all custom partition_points together in a library, or b) only put the infrastructure for such custom partition_points into a library and put the iterator-specific custom partition-points close to the respective iterator implementations.
b). -- Dave Abrahams BoostPro Computing http://www.boostpro.com