Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

reverse_view

reverse_view presents a reversed view of underlying sequence. The first element will be its last and the last element will be its first.

Header
#include <boost/fusion/view/reverse_view.hpp>
#include <boost/fusion/include/reverse_view.hpp>
Synopsis
template <typename Sequence>
struct reverse_view;
Template parameters

Parameter

Description

Default

Sequence

A Bidirectional Sequence

Model of

Notation

RV

A reverse_view type

s

An instance of Sequence

rv, rv2

Instances of reverse_view

Expression Semantics

Semantics of an expression is defined only where it differs from, or is not defined in the implemented models.

Expression

Semantics

RV(s)

Creates a unary reverse_view given sequence, s.

RV(rv)

Copy constructs a reverse_view from another reverse_view, rv.

rv = rv2

Assigns to a reverse_view, rv, from another reverse_view, rv2.

Example
typedef vector<int, short, double> vector_type;
vector_type vec(2, 5, 3.3);

reverse_view<vector_type> reverse(vec);
std::cout << reverse << std::endl;

PrevUpHomeNext