Back to Arangodb

clear

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/clear.html

3.12.9.12.6 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / clear |

clear

Synopsis

template<
      typename Sequence
    >
struct[clear](./clear.html){
    typedef_unspecified_type;
};

Description

Returns an empty sequence concept-identical to Sequence.

#include <[boost/mpl/clear.hpp](../../../../boost/mpl/clear.hpp)>

Model of

Tag Dispatched Metafunction

Parameters

ParameterRequirementDescription
SequenceExtensible Sequence or Extensible Associative SequenceA sequence to get an empty "copy" of.

Expression semantics

For any Extensible Sequence or Extensible Associative Sequence s:

typedef[clear](./clear.html)<s>::type t;

| Return type: |

Extensible Sequence or Extensible Associative Sequence.

| | Semantics: |

Equivalent to

typedef[erase](./erase.html)< s,[begin](./begin.html)<s>::type,[end](./end.html)<s>::type >::type t;

| | Postcondition: |

empty<s>::value == true.

|

Complexity

Amortized constant time.

Example

typedef[vector\_c](./vector-c.html)<int,1,3,5,7,9,11> odds;
typedef[clear](./clear.html)<odds>::type nothing;[BOOST\_MPL\_ASSERT](./assert.html)(([empty](./empty.html)<nothing> ));

See also

Extensible Sequence, Extensible Associative Sequence, erase, empty, begin, end

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |