Back to Arangodb

single_view

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/single-view.html

3.12.9.12.9 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Views / single_view |

single_view

Synopsis

template<
      typename T
    >
struct[single\_view](./single-view.html){
    //_unspecified_//_..._};

Description

A view onto an arbitrary type T as on a single-element sequence.

#include <[boost/mpl/single\_view.hpp](../../../../boost/mpl/single_view.hpp)>

Model of

Parameters

ParameterRequirementDescription
TAny typeThe type to be wrapped in a sequence.

Expression semantics

The semantics of an expression are defined only where they differ from, or are not defined in Random Access Sequence.

In the following table, v is an instance of single_view, x is an arbitrary type.

ExpressionSemantics
[single\_view](./single-view.html)<x>[single\_view](./single-view.html)<x>::type

| A single-element Random Access Sequence v such that front<v>::type is identical to x. | | size<v>::type | The size of v; size<v>::value == 1; see Random Access Sequence. |

Example

typedef[single\_view](./single-view.html)<int> view;
typedef[begin](./begin.html)<view>::type first;
typedef[end](./end.html)<view>::type last;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[deref](./deref.html)<first>::type,int > ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[next](./next.html)<first>::type,last > ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[prior](./prior.html)<last>::type,first > ));[BOOST\_MPL\_ASSERT\_RELATION](./assert-relation.html)([size](./size.html)<view>::value, ==, 1 );

See also

Sequences, Views, iterator_range, filter_view, transform_view, joint_view, zip_view

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