...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns a new sequence with the elements of the original in reverse order.
template<
typename Sequence
>
typename result_of::reverse
<Sequence const>::type reverse(Sequence const& seq);
Table 1.74. Parameters
Parameter |
Requirement |
Description |
---|---|---|
|
A model of Bidirectional Sequence |
Operation's argument |
reverse
(seq);
Return type:
seq
is a Bidirectional
Sequence else, Random
Access Sequence if seq
is a Random
Access Sequence.
seq
implements the Associative
Sequence model.
Semantics: Returns a new sequence containing
all the elements of seq
in reverse order.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/reverse.hpp> #include <boost/fusion/include/reverse.hpp>
assert(reverse
(make_vector
(1,2,3)) ==make_vector
(3,2,1));