template <class T, class Tag>
struct make_tmp_value
{
typedef T type;
// unspecified
};
When a class is used as a value for template metaprograms, it needs to behave as a nullary metafunction evaluating to itself to avoid issues when it is passed to lazy metafunctions. This metafunction can be used to add ::type
and optionally ::tag
to a type that doesn't have one.
#include <mpllibs/metamonad/make_tmp_value.hpp>
For any t
and v
types the following are equivalent:
make_tmp_value<t>::type
make_tmp_value<t>
tmp_value<t, v>::type
tmp_value<t, v>
tmp_value<t, v>::tag
v
For any t
and v
types make_tmp_value<t>
and make_tmp_value<t, v>
publicly inherit from t
.
make_tmp_value<boost::mpl::always<int>>
Copyright Abel Sinkovics (abel at elte dot hu) 2011. 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