| Home | Libraries | People | FAQ | More

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

- A model of Forward Sequence if `Sequence` is a Forward Sequence else, Bidirectional Sequence if `Sequence` is a Bidirectional Sequence else, Random Access Sequence if `Sequence` is a Random Access Sequence.
- Associative Sequence if `Sequence` implements the Associative Sequence model.

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)