...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Sequences / Intrinsic Metafunctions / order |
Returns a unique unsigned Integral Constant associated with the key Key in Sequence.
#include <boost/mpl/order.hpp>
Parameter | Requirement | Description |
---|---|---|
Sequence | Associative Sequence | A sequence to query. |
Key | Any type | The queried key. |
For any Associative Sequence s, and arbitrary type key:
typedef order<s,key>::type n;
Return type: | Unsigned Integral Constant. |
---|---|
Semantics: | If has_key<s,key>::value == true, n is a unique unsigned Integral Constant associated with key in s; otherwise, n is identical to void_. |
Amortized constant time.
typedef map< pair<int,unsigned>, pair<char,long> > m; BOOST_MPL_ASSERT_NOT(( is_same< order<m,int>::type, void_ > )); BOOST_MPL_ASSERT(( is_same< order<m,long>::type,void_ > ));