...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
template< typename Sequence > struct reverse { typedef implementation-defined type; };
Reverses a sequence. The result sequence preserves all the functional and performance characteristics of the original Sequence
, including its size, but not identity.
#include "boost/mpl/reverse.hpp"
Parameter | Requirement | Description |
---|---|---|
Sequence | A model of Extensible Sequence | The original sequence. |
Expression | Expression type | Precondition | Semantics | Postcondition |
---|---|---|---|---|
typedef reverse<Sequence>::type s; | A model of Extensible Sequence | size<s>::type::value == size<Sequence>::type::value . |
Linear.
typedef list_c<int,9,8,7,6,5,4,3,2,1,0>::type numbers; typedef reverse< numbers >::type result;typedef range_c<int,0,10> answer; BOOST_STATIC_ASSERT((equal<result,answer>::type::value));
Algorithms, transform
, remove
, remove_if