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

PrevUpHomeNext
empty
Description

Returns the result type of empty.

Synopsis
template<typename Seq>
struct empty
{
    typedef unspecified type;
};

Table 1.24. Parameters

Parameter

Requirement

Description

Seq

A model of Forward Sequence

Argument sequence


Expression Semantics
result_of::empty<Seq>::type

Return type: An MPL Integral Constant

Semantics: Returns mpl::true_ if Seq has zero elements, mpl::false_ otherwise.

Header
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/include/empty.hpp>
Example
typedef vector<> empty_vec;
typedef vector<int,float,char> vec;

BOOST_MPL_ASSERT((result_of::empty<empty_vec>));
BOOST_MPL_ASSERT_NOT((result_of::empty<vec>));

PrevUpHomeNext