Back to Arangodb

always

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/always.html

3.12.9.12.4 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / Miscellaneous / always |

always

Synopsis

template<
      typename X
    >
struct[always](./always.html){
    //_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.

#include <[boost/mpl/always.hpp](../../../../boost/mpl/always.hpp)>

Model of

Metafunction Class

Parameters

ParameterRequirementDescription
XAny typeA type to be returned.

Expression semantics

For an arbitrary type x:

typedef[always](./always.html)<x> f;

| Return type: |

Metafunction Class.

| | Semantics: |

Equivalent to

struct f :[bind](./bind.html)<[identity](./identity.html)<[\_1](./placeholders.html)>, x > {};

|

Example

typedef[always](./always.html)<[true\_](./bool.html)> always_true;[BOOST\_MPL\_ASSERT](./assert.html)(([apply](./apply.html)< always_true,[false\_](./bool.html)> ));[BOOST\_MPL\_ASSERT](./assert.html)(([apply](./apply.html)< always_true,[false\_](./bool.html),[false\_](./bool.html)> ));[BOOST\_MPL\_ASSERT](./assert.html)(([apply](./apply.html)< always_true,[false\_](./bool.html),[false\_](./bool.html),[false\_](./bool.html)> ));

See also

Metafunctions, Metafunction Class, identity, bind, 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) |