...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns the result type of has_key
.
template< typename Seq, typename Key> struct has_key { typedef unspecified type; };
Table 1.33. Parameters
Parameter |
Requirement |
Description |
---|---|---|
|
A model of Associative Sequence |
Argument sequence |
|
Any type |
Key type |
result_of::has_key<Seq, Key>::type
Return type: An MPL Integral Constant.
Semantics: Returns mpl::true_
if Seq
contains an element
with key type Key
, returns
mpl::false_
otherwise.
#include <boost/fusion/sequence/intrinsic/has_key.hpp> #include <boost/fusion/include/has_key.hpp>
typedefmap
<pair
<int, char>,pair
<char, char>,pair
<double, char> > mymap; BOOST_MPL_ASSERT((result_of::has_key
<mymap, int>)); BOOST_MPL_ASSERT_NOT((result_of::has_key
<mymap, void*>));