1 .. Sequences/Intrinsic Metafunctions//has_key
17 typedef |unspecified| type;
25 Returns a true-valued |Integral Constant| if ``Sequence`` contains an element
34 #include <boost/mpl/has_key.hpp>
40 |Tag Dispatched Metafunction|
46 +---------------+---------------------------+-----------------------------------------------+
47 | Parameter | Requirement | Description |
48 +===============+===========================+===============================================+
49 | ``Sequence`` | |Associative Sequence| | A sequence to query. |
50 +---------------+---------------------------+-----------------------------------------------+
51 | ``Key`` | Any type | The queried key. |
52 +---------------+---------------------------+-----------------------------------------------+
58 For any |Associative Sequence| ``s``, and arbitrary type ``key``:
62 typedef has_key<s,key>::type c;
65 Boolean |Integral Constant|.
68 ``c::value == true`` if ``key`` is in ``s``'s set of keys; otherwise
69 ``c::value == false``.
75 Amortized constant time.
83 typedef map< pair<int,unsigned>, pair<char,long> > m;
84 BOOST_MPL_ASSERT_NOT(( has_key<m,long> ));
86 typedef insert< m, pair<long,unsigned long> > m1;
87 BOOST_MPL_ASSERT(( has_key<m1,long> ));
93 |Associative Sequence|, |count|, |insert|, |erase_key|
96 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
97 Distributed under the Boost Software License, Version 1.0. (See accompanying
98 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)