3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/has-key.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / has_key |
template<
typename Sequence
, typename Key
>
struct[has\_key](./has-key.html){
typedef_unspecified_type;
};
Returns a true-valued Integral Constant if Sequence contains an element with key Key.
#include <[boost/mpl/has\_key.hpp](../../../../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](./has-key.html)<s,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](./map.html)<[pair](./pair.html)<int,unsigned>,[pair](./pair.html)<char,long> > m;[BOOST\_MPL\_ASSERT\_NOT](./assert-not.html)(([has\_key](./has-key.html)<m,long> ));
typedef[insert](./insert.html)< m,[pair](./pair.html)<long,unsigned long> > m1;[BOOST\_MPL\_ASSERT](./assert.html)(([has\_key](./has-key.html)<m1,long> ));
Associative Sequence, count, insert, erase_key
| 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) |