boost::mpl::clear

# clear

### Synopsis

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

### Description

Returns an empty sequence that preserves all the functional and performance characteristics of the original `Sequence`, except its size and identity.

### Definition

    #include "boost/mpl/clear.hpp"

### Parameters

Parameter | Requirement | Description
--- | --- | ---
`Sequence` | A model of Extensible Sequence |

### Expression semantics

Expression | Expression type | Precondition | Semantics | Postcondition
--- | --- | --- | --- | ---
`typedef clear<Sequence>::type s;` | A model of Extensible Sequence |  | Equivalent to `typedef erase<Sequence, begin<Sequence>::type, end<Sequence>::type>::type s;` | `empty<s>::type::value == true`

### Complexity

Amortized constant time [1].

### Example

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

### Notes

[1] The algorithm is provided only if the sequence can meet the stated complexity requirements.

### See also

Extensible Sequence, `erase`, `empty`, `begin`, `end`

Table of Contents
Last edited July 17, 2002 3:58 am