Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/mpl/doc/src/refmanual/clear.rst @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 1.8 KB

clear

Synopsis

template<
      typename Sequence
    >
struct clear
{
    typedef |unspecified| type;
};

Description

Returns an empty sequence |concept-identical| to Sequence.

Parameters

Parameter Requirement Description
Sequence |Extensible Sequence| or |Extensible Associative Sequence| A sequence to get an empty "copy" of.

Expression semantics

For any |Extensible Sequence| or |Extensible Associative Sequence| s:

typedef clear<s>::type t;
Return type:

|Extensible Sequence| or |Extensible Associative Sequence|.

Semantics:

Equivalent to

typedef erase< s, begin<s>::type, end<s>::type >::type t;
Postcondition:

empty<s>::value == true.

Complexity

Amortized constant time.

Example

typedef vector_c<int,1,3,5,7,9,11> odds;
typedef clear<odds>::type nothing;
BOOST_MPL_ASSERT(( empty<nothing> ));

Docutils System Messages

???????????????
Note: See TracBrowser for help on using the repository browser.