empty
template<
typename Sequence
>
struct empty
{
typedef unspecified type;
};
Returns an Integral Constant c such that c::value == true if and only if the sequence is empty.
#include "boost/mpl/empty.hpp"
| Parameter | Requirement | Description |
|---|---|---|
Sequence | A model of Sequence |
| Expression | Expression type | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
typedef empty<Sequence>::type c; | A model of bool Integral Constant | Equivalent to typedef is_same< begin<Sequence>::type,end<Sequence>::type >::type c; |
Amortized constant time.
typedef range_c<int,0,0> empty_range; typedef list<long,float,double> types;BOOST_STATIC_ASSERT(empty<empty_range>::value) BOOST_STATIC_ASSERT(!empty<types>::value)