source:
downloads/boost_1_33_1/libs/mpl/doc/src/refmanual/always.rst
@
12
| Last change on this file since 12 was 12, checked in by landauf, 18 years ago | |
|---|---|
| File size: 1.5 KB | |
always
Synopsis
template<
typename X
>
struct always
{
// |unspecified|
// |...|
};
Description
always<X> specialization is a variadic |Metafunction Class| always returning the same type, X, regardless of the number and types of passed arguments.
Header
#include <boost/mpl/always.hpp>
Model of
Parameters
| Parameter | Requirement | Description |
|---|---|---|
| X | Any type | A type to be returned. |
Expression semantics
For an arbitrary type x:
typedef always<x> f;
| Return type: | |
|---|---|
| Semantics: | Equivalent to
struct f : bind< identity<_1>, x > {};
|
Example
typedef always<true_> always_true; BOOST_MPL_ASSERT(( apply< always_true,false_> )); BOOST_MPL_ASSERT(( apply< always_true,false_,false_ > )); BOOST_MPL_ASSERT(( apply< always_true,false_,false_,false_ > ));
See also
|Metafunctions|, |Metafunction Class|, |identity|, |bind|, |apply|
Note: See TracBrowser
for help on using the repository browser.










