.. Sequences/Intrinsic Metafunctions//erase_key erase_key ========= Synopsis -------- .. parsed-literal:: template< typename AssocSeq , typename Key > struct erase_key { typedef |unspecified| type; }; Description ----------- Erases elements associated with the key ``Key`` in the |Extensible Associative Sequence| ``AssocSeq`` . Header ------ .. parsed-literal:: #include Model of -------- |Tag Dispatched Metafunction| Parameters ---------- +---------------+-----------------------------------+-----------------------------------------------+ | Parameter | Requirement | Description | +===============+===================================+===============================================+ | ``AssocSeq`` | |Extensible Associative Sequence| | A sequence to erase elements from. | +---------------+-----------------------------------+-----------------------------------------------+ | ``Key`` | Any type | A key for the elements to be removed. | +---------------+-----------------------------------+-----------------------------------------------+ Expression semantics -------------------- For any |Extensible Associative Sequence| ``s``, and arbitrary type ``key``: .. parsed-literal:: typedef erase_key::type r; :Return type: |Extensible Associative Sequence|. :Semantics: ``r`` is |concept-identical| and equivalent to ``s`` except that ``has_key::value == false``. :Postcondition: ``size::value == size::value - 1``. Complexity ---------- Amortized constant time. Example ------- .. parsed-literal:: typedef map< pair, pair > m; typedef erase_key::type m1; BOOST_MPL_ASSERT_RELATION( size::type::value, ==, 1 ); BOOST_MPL_ASSERT(( is_same< at::type,void\_ > )); BOOST_MPL_ASSERT(( is_same< at::type,unsigned > )); See also -------- |Extensible Associative Sequence|, |erase|, |has_key|, |insert|