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

Click here to view the latest version of this page.
PrevUpHomeNext

is_sequence

Description

Metafunction that evaluates to mpl::true_ if a certain type T is a conforming Fusion Sequence, mpl::false_ otherwise. This may be specialized to accomodate clients which provide Fusion conforming sequences.

Synopsis
namespace traits
{
    template <typename T>
    struct is_sequence
    {
        typedef unspecified type;
    };
}
Parameters

Parameter

Requirement

Description

T

Any type

The type to query.

Expression Semantics
typedef traits::is_sequence<T>::type c;

Return type: An MPL Boolean Constant.

Semantics: Metafunction that evaluates to mpl::true_ if a certain type T is a conforming Fusion sequence, mpl::false_ otherwise.

Header
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/include/is_sequence.hpp>
Example
BOOST_MPL_ASSERT_NOT(( traits::is_sequence< std::vector<int> > ));
BOOST_MPL_ASSERT_NOT(( is_sequence< int > ));
BOOST_MPL_ASSERT(( traits::is_sequence<list<> > ));
BOOST_MPL_ASSERT(( traits::is_sequence<list<int> > ));
BOOST_MPL_ASSERT(( traits::is_sequence<vector<> > ));
BOOST_MPL_ASSERT(( traits::is_sequence<vector<int> > ));

PrevUpHomeNext