Boost C++ Libraries 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.
Front Page / Sequences / Views / empty_sequence



struct empty_sequence
    // unspecified
    // ...


Represents a sequence containing no elements.


#include <boost/mpl/empty_sequence.hpp>

Expression semantics

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

In the following table, s is an instance of empty_sequence.

Expression Semantics
empty_sequence An empty Random Access Sequence.
size<s>::type size<s>::value == 0; see Random Access Sequence.


typedef begin<empty_sequence>::type first;
typedef end<empty_sequence>::type last;

BOOST_MPL_ASSERT(( is_same<first,last> ));
BOOST_MPL_ASSERT_RELATION( size<empty_sequence>::value, ==, 0 );

typedef transform_view<
    , add_pointer<_>
    > empty_view;

BOOST_MPL_ASSERT_RELATION( size<empty_sequence>::value, ==, 0 );

See also

Sequences, Views, vector, list, single_view