Thorsten Ottosen skrev:
chun ping wang skrev:
well merge, union, intersection algorithm..
merge() is there as a member function, the others are not.
I'll put boost::clone_back_inserter() or boost::ptr_back_inserter() on my todo. They are not hard to do.
I've uploaded boost/ptr_container/clone_inserter.hpp to trunk.
Here's the synopsis:
namespace boost
{
namespace ptr_container
{
template< class PtrContainer >
class clone_back_insert_iterator;
template< class PtrContainer >
class clone_front_insert_iterator;
template< class PtrContainer >
class clone_insert_iterator;
template< class PtrContainer >
clone_back_insert_iterator<PtrContainer>
clone_back_inserter( PtrContainer& cont );
template< class PtrContainer >
clone_front_insert_iterator<PtrContainer>
clone_front_inserter( PtrContainer& cont );
template< class PtrContainer >
clone_insert_iterator<PtrContainer>
clone_inserter( PtrContainer& cont,
typename PtrContainer::iterator before );
}
}
Each iterator defines three different versions of operator=(), because
there are slightly different situations to handle,e.g. for
clone_back_insert_iterator:
clone_back_insert_iterator&
operator=( typename PtrContainer::value_type r );
template< class T >
clone_back_insert_iterator&
operator=( std::auto_ptr<T> r );
clone_back_insert_iterator&
operator=( typename PtrContainer::const_reference r )
The first copies null's correctly. he second can be used with a moving
transform iterator. The third is most handy, but requires a container
without nulls. Some examples:
std::copy( boost::make_transform_iterator( seq.begin().base(),
caster_to