...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns a type convertible to bool
that evaluates to true
if
the sequence contains an element associated with a Key, else, evaluates
to false
.
template <typename Key, typename Sequence>
typename result_of::has_key
<Sequence, Key>::type
has_key(Sequence const& seq);
Parameter |
Requirement |
Description |
---|---|---|
|
Model of Associative Sequence |
The sequence we wish to investigate. |
|
Any type |
The queried key. |
has_key<Key>(seq);
Return type: Convertible to bool
.
Semantics: Evaluates to true
if the sequence contains an element
associated with Key, else, evaluates to false
.
#include <boost/fusion/sequence/intrinsic/has_key.hpp> #include <boost/fusion/include/has_key.hpp>
set
<int, char, bool> s(1, 'x', true);
assert(has_key<char>(s) == true);