1 .. Metafunctions/Miscellaneous//identity |10
23 The `identity`__ metafunction. Returns ``X`` unchanged.
25 __ http://mathworld.wolfram.com/IdentityFunction.html
33 #include <boost/mpl/identity.hpp>
45 +---------------+-------------------+-----------------------------------+
46 | Parameter | Requirement | Description |
47 +===============+===================+===================================+
48 | ``X`` | Any type | An argument to be returned. |
49 +---------------+-------------------+-----------------------------------+
55 For an arbitrary type ``x``:
60 typedef identity<x>::type r;
74 ``is_same<r,x>::value == true``.
83 typedef apply< identity<_1>, char >::type t1;
84 typedef apply< identity<_2>, char,int >::type t2;
86 BOOST_MPL_ASSERT(( is_same< t1, char > ));
87 BOOST_MPL_ASSERT(( is_same< t2, int > ));
93 |Metafunctions|, |Placeholders|, |Trivial Metafunctions|, |always|, |apply|
96 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
97 Distributed under the Boost Software License, Version 1.0. (See accompanying
98 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)