1 .. Sequences/Intrinsic Metafunctions//erase_key
17 typedef |unspecified| type;
25 Erases elements associated with the key ``Key`` in the |Extensible Associative Sequence|
33 #include <boost/mpl/erase_key.hpp>
39 |Tag Dispatched Metafunction|
45 +---------------+-----------------------------------+-----------------------------------------------+
46 | Parameter | Requirement | Description |
47 +===============+===================================+===============================================+
48 | ``AssocSeq`` | |Extensible Associative Sequence| | A sequence to erase elements from. |
49 +---------------+-----------------------------------+-----------------------------------------------+
50 | ``Key`` | Any type | A key for the elements to be removed. |
51 +---------------+-----------------------------------+-----------------------------------------------+
57 For any |Extensible Associative Sequence| ``s``, and arbitrary type ``key``:
62 typedef erase_key<s,key>::type r;
65 |Extensible Associative Sequence|.
68 ``r`` is |concept-identical| and equivalent to ``s`` except that
69 ``has_key<r,k>::value == false``.
72 ``size<r>::value == size<s>::value - 1``.
79 Amortized constant time.
87 typedef map< pair<int,unsigned>, pair<char,long> > m;
88 typedef erase_key<m,char>::type m1;
90 BOOST_MPL_ASSERT_RELATION( size<m1>::type::value, ==, 1 );
91 BOOST_MPL_ASSERT(( is_same< at<m1,char>::type,void\_ > ));
92 BOOST_MPL_ASSERT(( is_same< at<m1,int>::type,unsigned > ));
98 |Extensible Associative Sequence|, |erase|, |has_key|, |insert|
101 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
102 Distributed under the Boost Software License, Version 1.0. (See accompanying
103 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)