3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/erase-key.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / erase_key |
template<
typename AssocSeq
, typename Key
>
struct[erase\_key](./erase-key.html){
typedef_unspecified_type;
};
Erases elements associated with the key Key in the Extensible Associative SequenceAssocSeq .
#include <[boost/mpl/erase\_key.hpp](../../../../boost/mpl/erase_key.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| AssocSeq | Extensible Associative Sequence | A sequence to erase elements from. |
| Key | Any type | A key for the elements to be removed. |
For any Extensible Associative Sequence s, and arbitrary type key:
typedef[erase\_key](./erase-key.html)<s,key>::type r;
| Return type: | Extensible Associative Sequence. | | Semantics: | r is concept-identical and equivalent to s except that has_key<r,k>::value == false. | | Postcondition: | size<r>::value == size<s>::value - 1. |
Amortized constant time.
typedef[map](./map.html)<[pair](./pair.html)<int,unsigned>,[pair](./pair.html)<char,long> > m;
typedef[erase\_key](./erase-key.html)<m,char>::type m1;[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<m1>::type::value, ==, 1 );[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[at](./at.html)<m1,char>::type,[void\_](./void.html)> ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[at](./at.html)<m1,int>::type,unsigned > ));
Extensible Associative Sequence, erase, has_key, insert
| Prev Next | Back Along | Up Home | Full TOC |
Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |