Back to Arangodb

has_key

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

3.12.9.12.5 KB
Original Source

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

has_key

Synopsis

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

Description

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

Model of

Tag Dispatched Metafunction

Parameters

ParameterRequirementDescription
SequenceAssociative SequenceA sequence to query.
KeyAny typeThe queried key.

Expression semantics

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

Complexity

Amortized constant time.

Example

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

See also

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