2002-09-16 19:25:33 +00:00
<!doctype html public "-//ietf//dtd html//en">
2003-03-12 13:29:12 +00:00
< html >< head >< title > boost::mpl::clear</ title >
2002-09-16 19:25:33 +00:00
< link rel = "stylesheet" href = "../mpl_wiki.css" >
</ head >< body bgcolor = "white" >
2003-03-12 13:29:12 +00:00
< h1 >< a href = "../Table_of_Contents.html" >< img src = "../mpl_logo.jpg" alt = "[Home]" border = 0 align = "right" ></ a > clear</ h1 >< h3 > Synopsis</ h3 >
2002-09-16 19:25:33 +00:00
< p >
< pre >
template<
typename Sequence
>
struct clear
{
typedef < em > unspecified</ em > type;
};
</ pre >
< p >
< h3 > Description</ h3 >
< p >
Returns an empty sequence that preserves all the functional and performance characteristics of the original < code > Sequence</ code > , except its size and identity.
< p >
< h3 > Definition</ h3 >
< p >
< pre >
2003-03-12 13:29:12 +00:00
#include "< a href = "../../../../../boost/mpl/clear.hpp" > boost/mpl/clear.hpp</ a > "
2002-09-16 19:25:33 +00:00
</ pre >
< p >
< h3 > Parameters</ h3 >
< table border = "1" >
< tr >< th > Parameter </ th >< th > Requirement </ th >< th > Description </ th ></ tr >
< tr >< td >< code > Sequence</ code ></ td >< td > A model of < a href = "../Extensible_Sequence.html" > Extensible Sequence</ a ></ td >< td ></ td ></ tr >
</ table >
< p >
< h3 > Expression semantics</ h3 >
< p >
< table border = "1" >
< tr >< th > Expression </ th >< th > Expression type </ th >< th > Precondition </ th >< th > Semantics </ th >< th > Postcondition </ th ></ tr >
< tr >< td >< code > typedef clear< Sequence> ::type s;</ code ></ td >< td > A model of < a href = "../Extensible_Sequence.html" > Extensible Sequence</ a ></ td >< td ></ td >< td > Equivalent to < code > typedef erase< Sequence, begin< Sequence> ::type, end< Sequence> ::type> ::type s;</ code ></ td >< td >< code > empty< s> ::type::value == true</ code > </ td ></ tr >
</ table >
< p >
< h3 > Complexity</ h3 >
< p >
Amortized constant time [< a href = "#1" > 1</ a > ].
< p >
< h3 > Example</ h3 >
< p >
< pre >
typedef list_c< int,1,3,5,7,9,11> odds;
typedef clear< odds> ::type nothing;
BOOST_STATIC_ASSERT(empty< nothing> ::type::value);
</ pre >
< p >
< h3 > Notes</ h3 >
< p >
[< a name = "1" > 1</ a > ] The algorithm is provided only if the sequence can meet the stated complexity requirements.< br >
< p >
< h3 > See also</ h3 >
< p >
< a href = "../Extensible_Sequence.html" > Extensible Sequence</ a > , < code >< a href = "../Reference/erase.html" > erase</ a ></ code > , < code >< a href = "../Reference/empty.html" > empty</ a ></ code > , < code >< a href = "../Reference/begin.html" > begin</ a ></ code > , < code >< a href = "../Reference/end.html" > end</ a ></ code >
< p >< hr >
2003-03-12 13:29:12 +00:00
< a href = "../Table_of_Contents.html" > Table of Contents</ a >< br > Last edited July 17, 2002 3:58 am</ body ></ html >