Back to Arangodb

reverse

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

3.12.9.12.6 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Algorithms / Transformation Algorithms / reverse |

reverse

Synopsis

template<
      typename Sequence
    , typename In =_unspecified_>
struct[reverse](./reverse.html){
    typedef_unspecified_type;
};

Description

Returns a reversed copy of the original sequence. reverse is a synonym for reverse_copy.

[Note: This wording applies to a no-inserter version(s) of the algorithm. See the Expression semantics subsection for a precise specification of the algorithm's details in all cases — end note]

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

Parameters

ParameterRequirementDescription
SequenceForward SequenceA sequence to reverse.
InInserterAn inserter.

Expression semantics

For any Forward Sequence s, and an Inserter in:

typedef[reverse](./reverse.html)<s,in>::type r;

| Return type: |

A type.

| | Semantics: |

Equivalent to

typedef[reverse\_copy](./reverse-copy.html)<s,in>::type r;

|

Complexity

Linear.

Example

typedef[vector\_c](./vector-c.html)<int,9,8,7,6,5,4,3,2,1,0> numbers;
typedef[reverse](./reverse.html)< numbers >::type result;[BOOST\_MPL\_ASSERT](./assert.html)(([equal](./equal.html)< result,[range\_c](./range-c.html)<int,0,10> > ));

See also

Transformation Algorithms, Reversible Algorithm, reverse_copy, copy, copy_if

| 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) |