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

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

[Home]is_sequence

Synopsis

template<
      typename T
    >
struct is_sequence
{
    typedef unspecified type;
};

Description

Returns an Integral Constant c such that c::value == true if and only if T is a model of Sequence.

Definition

#include "boost/mpl/is_sequence.hpp"

Parameters

 Parameter  Requirement  Description  
TA type

Expression semantics

 Expression  Expression type  Precondition  Semantics  Postcondition 
typedef is_sequence<T>::type c;A model of bool Integral ConstantEquivalent to typedef not_< is_same< begin<T>::type,void_ > >::type c;

Complexity

Amortized constant time.

Example

struct UDT {};
BOOST_STATIC_ASSERT( !is_sequence<int>::value );
BOOST_STATIC_ASSERT( !is_sequence<UDT>::value );
BOOST_STATIC_ASSERT( is_sequence< list<> >::value );
BOOST_STATIC_ASSERT( is_sequence< vector<> >::value );

See also

Sequence, begin, end, as_sequence


Table of Contents
Last edited July 1, 2003 4:08 pm