3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/identity.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / Miscellaneous / identity |
template<
typename X
>
struct[identity](./identity.html){
typedef X type;
};
The identity metafunction. Returns X unchanged.
#include <[boost/mpl/identity.hpp](../../../../boost/mpl/identity.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| X | Any type | An argument to be returned. |
For an arbitrary type x:
typedef[identity](./identity.html)<x>::type r;
| Return type: |
A type.
| | Semantics: |
Equivalent to
typedef x r;
| | Postcondition: |
is_same<r,x>::value == true.
|
typedef[apply](./apply.html)<[identity](./identity.html)<[\_1](./placeholders.html)>, char >::type t1;
typedef[apply](./apply.html)<[identity](./identity.html)<[\_2](./placeholders.html)>, char,int >::type t2;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same< t1, char > ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same< t2, int > ));
Metafunctions, Placeholders, Trivial Metafunctions, always, apply
| 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) |