![]() |
![]() ![]() ![]() ![]() |
![]() |
The MPL Reference Manual: identityBoost , ,
|
||||||||||||||||||||
| Front Page / Metafunctions / Miscellaneous / identity |
Метафункция идентичность. Возвращение X без изменений.
#include <boost/mpl/identity.hpp>
| Parameter | Requirement | Description |
|---|---|---|
| X | Любой тип | Спор, который должен быть возвращен. |
Для произвольного типа x:
typedef identity<x>::type r;
| Return type: | A type. |
|---|---|
| Semantics: | Equivalent to typedef x r; |
| Postcondition: | is_same<r,x>::value == true. |
typedef apply< identity<_1>, char >::type t1; typedef apply< identity<_2>, char,int >::type t2; BOOST_MPL_ASSERT(( is_same< t1, char > )); BOOST_MPL_ASSERT(( is_same< t2, int > ));
Статья The MPL Reference Manual: identity раздела может быть полезна для разработчиков на c++ и boost.
:: Главная :: ::
реклама |