...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Sequences / Intrinsic Metafunctions / has_key |
Returns a true-valued Integral Constant if Sequence contains an element with key Key.
#include <boost/mpl/has_key.hpp>
Parameter | Requirement | Description |
---|---|---|
Sequence | Associative Sequence | A sequence to query. |
Key | Any type | The queried key. |
For any Associative Sequence s, and arbitrary type key:
typedef has_key::type c;
Return type: | Boolean Integral Constant. |
---|---|
Semantics: | c::value == true if key is in s's set of keys; otherwise c::value == false. |
Amortized constant time.
typedef map< pair, pair > m; BOOST_MPL_ASSERT_NOT(( has_key )); typedef insert< m, pair > m1; BOOST_MPL_ASSERT(( has_key ));