Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

added boost

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.

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:

|Metafunction Class|.

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

Docutils System Messages

??????????
Note: See TracBrowser for help on using the repository browser.