...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.29. Parameters
Parameter |
Requirement |
Description |
---|---|---|
Seq |
A model of Forward Sequence |
Argument sequence |
Key |
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.
/sequence/intrinsic/has_key.hpp>
typedef map<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*>));