source:
downloads/boost_1_33_1/libs/mpl/doc/src/refmanual/empty.rst
@
12
Last change on this file since 12 was 12, checked in by landauf, 17 years ago | |
---|---|
File size: 1.6 KB |
empty
Synopsis
template< typename Sequence > struct empty { typedef |unspecified| type; };
Description
Returns an |Integral Constant| c such that c::value == true if and only if the sequence is empty.
Header
#include <boost/mpl/empty.hpp>
Model of
Parameters
Parameter | Requirement | Description |
---|---|---|
Sequence | |Forward Sequence| | A sequence to test. |
Expression semantics
For any |Forward Sequence| s:
typedef empty<s>::type c;
Return type: | Boolean |Integral Constant|. |
---|---|
Semantics: | Equivalent to typedef is_same< begin<s>::type,end<s>::type >::type c;. |
Postcondition: | empty<s>::value == ( size<s>::value == 0 ). |
Complexity
Amortized constant time.
Example
typedef range_c<int,0,0> empty_range; typedef vector<long,float,double> types; BOOST_MPL_ASSERT( empty<empty_range> ); BOOST_MPL_ASSERT_NOT( empty<types> );
See also
|Forward Sequence|, |Integral Constant|, |size|, |begin| / |end|
Note: See TracBrowser
for help on using the repository browser.