Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

The MPL Reference Manual: set_c
Front Page / Sequences / Classes / set_c

set_c

Description

set_c is an Integral Sequence Wrapper for set. As such, it shares all set characteristics and requirements, and differs only in the way the original sequence content is specified.

Header

Sequence form Header
Variadic #include <boost/mpl/set_c.hpp>
Numbered #include n_c.hpp>

Expression semantics

The semantics of an expression are defined only where they differ from, or are not defined in set.

Expression Semantics
set_cc1,c2,... cn>
setn_cc1,c2,... cn>
A set of integral constant wrappers integral_cc1>, integral_cc2>, ... integral_ccn>; see Integral Sequence Wrapper.
set_cc1,c2,... cn>::type
setn_cc1,c2,... cn>::type
Identical to setn< integral_cc1>, integral_cc2>, ... integral_ccn> >; see Integral Sequence Wrapper.
set_cc1,c2,... cn>::value_type
setn_cc1,c2,... cn>::value_type
Identical to T; see Integral Sequence Wrapper.

Example

typedef set_c< int,1,3,5,7,9 > odds;

BOOST_MPL_ASSERT_RELATION( size::value, ==, 5 );
BOOST_MPL_ASSERT_NOT(( empty ));

BOOST_MPL_ASSERT(( has_key< odds, integral_c > ));
BOOST_MPL_ASSERT_NOT(( has_key< odds, integral_c > ));
BOOST_MPL_ASSERT_NOT(( has_key< odds, integral_c > ));