1 .. Metafunctions/Miscellaneous//always |20
24 ``always<X>`` specialization is a variadic |Metafunction Class| always returning the
25 same type, ``X``, regardless of the number and types of passed arguments.
33 #include <boost/mpl/always.hpp>
44 +---------------+-------------------+-----------------------------------+
45 | Parameter | Requirement | Description |
46 +===============+===================+===================================+
47 | ``X`` | Any type | A type to be returned. |
48 +---------------+-------------------+-----------------------------------+
54 For an arbitrary type ``x``:
69 struct f : bind< identity<_1>, x > {};
77 typedef always<true\_> always_true;
79 BOOST_MPL_ASSERT(( apply< always_true,false\_> ));
80 BOOST_MPL_ASSERT(( apply< always_true,false\_,false\_ > ));
81 BOOST_MPL_ASSERT(( apply< always_true,false\_,false\_,false\_ > ));
87 |Metafunctions|, |Metafunction Class|, |identity|, |bind|, |apply|
90 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
91 Distributed under the Boost Software License, Version 1.0. (See accompanying
92 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)