...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 / is_sequence |
template< typename X > struct is_sequence { typedef unspecified type; };
Returns a boolean Integral Constant c such that c::value == true if and only if X is a model of Forward Sequence.
#include <boost/mpl/is_sequence.hpp>
Parameter | Requirement | Description |
---|---|---|
X | Any type | The type to query. |
typedef is_sequence<X>::type c;
Return type: | Boolean Integral Constant. |
---|---|
Semantics: | Equivalent to typedef not_< is_same< begin<T>::type,void_ > >::type c; |
Amortized constant time.
struct UDT {}; BOOST_MPL_ASSERT_NOT(( is_sequence< std::vector<int> > )); BOOST_MPL_ASSERT_NOT(( is_sequence< int > )); BOOST_MPL_ASSERT_NOT(( is_sequence< int& > )); BOOST_MPL_ASSERT_NOT(( is_sequence< UDT > )); BOOST_MPL_ASSERT_NOT(( is_sequence< UDT* > )); BOOST_MPL_ASSERT(( is_sequence< range_c<int,0,0> > )); BOOST_MPL_ASSERT(( is_sequence< list<> > )); BOOST_MPL_ASSERT(( is_sequence< list<int> > )); BOOST_MPL_ASSERT(( is_sequence< vector<> > )); BOOST_MPL_ASSERT(( is_sequence< vector<int> > ));