1++++++++++++++++++++++++++++++++++ 2 |Boost| Pointer Container Library 3++++++++++++++++++++++++++++++++++ 4 5.. |Boost| image:: boost.png 6 7Class ``ptr_multiset_adapter`` 8------------------------------ 9 10This class is used to build custom pointer containers with 11an underlying multiset-like container. The interface of the class is an extension 12of the interface from ``associative_ptr_container``. 13 14**Hierarchy:** 15 16- `reversible_ptr_container <reversible_ptr_container.html>`_ 17 18 - `associative_ptr_container <associative_ptr_container.html>`_ 19 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>`_ 24 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>`_ 29 30**Navigate:** 31 32- `home <ptr_container.html>`_ 33- `reference <reference.html>`_ 34 35**Synopsis:** 36 37.. parsed-literal:: 38 39 40 namespace boost 41 { 42 template 43 < 44 class Key, 45 class VoidPtrMultiSet, 46 class CloneAllocator = heap_clone_allocator 47 > 48 class ptr_multiset_adapter 49 { 50 51 public: // `modifiers`_ 52 iterator insert( Key* x ); 53 template< class Key2 > 54 iterator insert( compatible-smart-ptr<Key2> x ); 55 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 ); 62 63 }; // class 'ptr_multiset_adapter' 64 65 } // namespace 'boost' 66 67 68Semantics 69--------- 70 71.. _`modifiers`: 72 73Semantics: modifiers 74^^^^^^^^^^^^^^^^^^^^ 75 76- ``iterator insert( key_type* x );`` 77 78 - Requirements: ``x != 0`` 79 80 - Effects: Takes ownership of ``x``. The returned iterator points to the element with key ``x``. 81 82 - Throws: bad_pointer if ``x == 0`` 83 84 - Exception safety: Strong guarantee 85 86 87- ``template< class Key2 > iterator insert( compatible-smart-ptr<Key2> x );`` 88 89 - Effects: ``return insert( x.release() );`` 90 91.. 92 - ``iterator insert( const key_type& x );`` 93 94 - Effects: ``return insert( allocate_clone( x ) );`` 95 96 - Exception safety: Strong guarantee 97 98.. _`pointer container requirements`: 99 100Semantics: pointer container requirements 101^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 102 103- ``void transfer( iterator object, ptr_multiset_adapter& from );`` 104 105 - Requirements: ``not from.empty()`` 106 107 - Effects: Inserts the object defined by ``object`` into the container and remove it from ``from``. 108 109 - Postconditions: ``size()`` is one more, ``from.size()`` is one less. 110 111 - Exception safety: Strong guarantee 112 113- ``void transfer( iterator first, iterator last, ptr_multiset_adapter& from );`` 114 115 - Requirements: ``not from.empty()`` 116 117 - Effects: Inserts the objects defined by the range ``[first,last)`` into the container and remove it from ``from``. 118 119 - Postconditions: Let ``N == std::distance(first,last);`` then ``size()`` is ``N`` more, ``from.size()`` is ``N`` less. 120 121 - Exception safety: Basic guarantee 122 123- ``template< class Range > void transfer( const Range& r, ptr_multiset_adapter& from );`` 124 125 - Effects: ``transfer( boost::begin(r), boost::end(r), from );`` 126 127- ``void transfer( ptr_multiset_adapter& from );`` 128 129 - Effects: ``transfer( from.begin(), from.end(), from );``. 130 131 - Postconditions: ``from.empty();`` 132 133 - Exception safety: Basic guarantee 134 135.. raw:: html 136 137 <hr> 138 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__). 140 141__ http://www.boost.org/LICENSE_1_0.txt 142 143 144