Back to Arangodb

erase_key

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/erase-key.html

3.12.9.12.9 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / erase_key |

erase_key

Synopsis

template<
      typename AssocSeq
    , typename Key
    >
struct[erase\_key](./erase-key.html){
    typedef_unspecified_type;
};

Description

Erases elements associated with the key Key in the Extensible Associative SequenceAssocSeq .

#include <[boost/mpl/erase\_key.hpp](../../../../boost/mpl/erase_key.hpp)>

Model of

Tag Dispatched Metafunction

Parameters

ParameterRequirementDescription
AssocSeqExtensible Associative SequenceA sequence to erase elements from.
KeyAny typeA key for the elements to be removed.

Expression semantics

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. |

Complexity

Amortized constant time.

Example

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 > ));

See also

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) |