1 ++++++++++++++++++++++++++++++++++
2 |Boost| Pointer Container Library
3 ++++++++++++++++++++++++++++++++++
5 .. |Boost| image:: boost.png
7 Class ``ptr_multiset_adapter``
8 ------------------------------
10 This class is used to build custom pointer containers with
11 an underlying multiset-like container. The interface of the class is an extension
12 of the interface from ``associative_ptr_container``.
16 - `reversible_ptr_container <reversible_ptr_container.html>`_
18 - `associative_ptr_container <associative_ptr_container.html>`_
20 - `ptr_set_adapter <ptr_set_adapter.html>`_
21 - ``ptr_multiset_adapter``
22 - `ptr_map_adapter <ptr_map_adapter.html>`_
23 - `ptr_multi_map_adapter <ptr_multimap_adapter.html>`_
25 - `ptr_set <ptr_set.html>`_
26 - `ptr_multi_set <ptr_multiset.html>`_
27 - `ptr_map <ptr_map.html>`_
28 - `ptr_multimap <ptr_multimap.html>`_
32 - `home <ptr_container.html>`_
33 - `reference <reference.html>`_
45 class VoidPtrMultiSet,
46 class CloneAllocator = heap_clone_allocator
48 class ptr_multiset_adapter
51 public: // `modifiers`_
52 iterator insert( Key* x );
53 template< class Key2 >
54 iterator insert( std::auto_ptr<Key2> x );
56 public: // `pointer container requirements`_
57 void transfer( iterator object, ptr_multiset_adapter& from );
58 size_type transfer( iterator first, iterator last, ptr_multiset_adapter& from );
59 template< class Range >
60 size_type transfer( const Range& r, ptr_multiset_adapter& from );
61 void transfer( ptr_multiset_adapter& from );
63 }; // class 'ptr_multiset_adapter'
65 } // namespace 'boost'
76 - ``iterator insert( key_type* x );``
78 - Requirements: ``x != 0``
80 - Effects: Takes ownership of ``x``. The returned iterator points to the element with key ``x``.
82 - Throws: bad_pointer if ``x == 0``
84 - Exception safety: Strong guarantee
87 - ``template< class Key2 > iterator insert( std::auto_ptr<Key2> x );``
89 - Effects: ``return insert( x.release() );``
92 - ``iterator insert( const key_type& x );``
94 - Effects: ``return insert( allocate_clone( x ) );``
96 - Exception safety: Strong guarantee
98 .. _`pointer container requirements`:
100 Semantics: pointer container requirements
101 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103 - ``void transfer( iterator object, ptr_multiset_adapter& from );``
105 - Requirements: ``not from.empty()``
107 - Effects: Inserts the object defined by ``object`` into the container and remove it from ``from``.
109 - Postconditions: ``size()`` is one more, ``from.size()`` is one less.
111 - Exception safety: Strong guarantee
113 - ``void transfer( iterator first, iterator last, ptr_multiset_adapter& from );``
115 - Requirements: ``not from.empty()``
117 - Effects: Inserts the objects defined by the range ``[first,last)`` into the container and remove it from ``from``.
119 - Postconditions: Let ``N == std::distance(first,last);`` then ``size()`` is ``N`` more, ``from.size()`` is ``N`` less.
121 - Exception safety: Basic guarantee
123 - ``template< class Range > void transfer( const Range& r, ptr_multiset_adapter& from );``
125 - Effects: ``transfer( boost::begin(r), boost::end(r), from );``
127 - ``void transfer( ptr_multiset_adapter& from );``
129 - Effects: ``transfer( from.begin(), from.end(), from );``.
131 - Postconditions: ``from.empty();``
133 - Exception safety: Basic guarantee
139 :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__).
141 __ http://www.boost.org/LICENSE_1_0.txt