...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Sequences / Intrinsic Metafunctions / clear |
Returns an empty sequence concept-identical to Sequence.
#include <boost/mpl/clear.hpp>
Parameter | Requirement | Description |
---|---|---|
Sequence | Extensible Sequence or Extensible Associative Sequence | A sequence to get an empty "copy" of. |
For any Extensible Sequence or Extensible Associative Sequence s:
typedef clear<s>::type t;
Return type: | |
---|---|
Semantics: | Equivalent to typedef erase< s, begin<s>::type, end<s>::type >::type t; |
Postcondition: | empty<s>::value == true. |
Amortized constant time.
typedef vector_c<int,1,3,5,7,9,11> odds; typedef clear<odds>::type nothing; BOOST_MPL_ASSERT(( empty<nothing> ));