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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

identity_view

Description

identity_view presents underlying sequence unchanged.

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

Parameter

Description

Default

Sequence

A Forward Sequence

Model of

Notation

IV

An identity_view type

s

An instance of Sequence

iv, iv2

Instances of identity_view

Expression Semantics

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

Expression

Semantics

IV(s)

Creates an identity_view given sequence, s.

IV(iv)

Copy constructs an identity_view from another identity_view, iv.

iv = iv2

Assigns to an identity_view, iv, from another identity_view, iv2.

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

identity_view<vector_type> identity(vec);
std::cout << identity << std::endl; // (2 5 3.3)

PrevUpHomeNext