empty
template<
typename Sequence
>
struct empty
{
typedef unspecified type;
};
シーケンスがemptyの時のみ,c::value == trueになるように,
汎整数定数cを返す.
#include "boost/mpl/empty.hpp"
| Parameter | Requirement | Description |
|---|---|---|
Sequence | Sequenceのモデル |
| Expression | Expression type | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
typedef empty<Sequence>::type c; | bool Integral Constantのモデル |
typedef is_same< begin<Sequence>::type,end<Sequence>::type >::type c;と等価 |
償却定数時間
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)