1 ++++++++++++++++++++++++++++++++++
2 |Boost| Pointer Container Library
3 ++++++++++++++++++++++++++++++++++
5 .. |Boost| image:: boost.png
10 When you work with normal value-based containers and algorithms, you often
11 use insert iterators ::
15 std::vector<int> coll2;
16 std::copy( coll1.begin(), coll1.end(),
17 back_inserter(coll2) );
19 With the special insert iterators for pointer containers,
20 you can do exactly the same ::
22 boost::ptr_list<Base> coll1;
24 boost::ptr_vector<Base> coll2;
25 std::copy( coll1.begin(), coll1.end(),
26 boost::ptr_container::ptr_back_inserter(coll2) );
28 Each element is cloned and inserted into the container. Furthermore,
29 if the source range iterates over pointers
30 instead of references, ``NULL`` pointers
31 can be transfered as well.
35 - `home <ptr_container.html>`_
36 - `reference <reference.html>`_
44 namespace ptr_container
47 template< class PtrContainer >
48 class ptr_back_insert_iterator;
50 template< class PtrContainer >
51 class ptr_front_insert_iterator;
53 template< class PtrContainer >
54 class ptr_insert_iterator;
56 template< class PtrContainer >
57 ptr_back_insert_iterator<PtrContainer>
58 ptr_back_inserter( PtrContainer& cont );
60 template< class PtrContainer >
61 ptr_front_insert_iterator<PtrContainer>
62 ptr_front_inserter( PtrContainer& cont );
64 template< class PtrContainer >
65 ptr_insert_iterator<PtrContainer>
66 ptr_inserter( PtrContainer& cont, typename PtrContainer::iterator before );
68 } // namespace 'ptr_container'
69 } // namespace 'boost'
75 :Copyright: Thorsten Ottosen 2008. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__).
77 __ http://www.boost.org/LICENSE_1_0.txt