/usr/include/boost/parameter
Edit: /usr/include/boost/parameter/value_type.hpp (5530B)
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_VALUE_TYPE_060921_HPP
#define BOOST_PARAMETER_VALUE_TYPE_060921_HPP
#include
#include
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include
#include
#include
#include
#else
#include
#include
#include
#include
#include
#include
#include
#endif
namespace boost { namespace parameter {
// A metafunction that, given an argument pack, returns the value type
// of the parameter identified by the given keyword. If no such parameter
// has been specified, returns Default
template
struct value_type0
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_apply_q<
typename Parameters::binding
, ::boost::mp11::mp_list
>;
static_assert(
::boost::mp11::mp_if<
::std::is_same
, ::boost::mp11::mp_if<
::std::is_same
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_true
>::value
, "required parameters must not result in void_ type"
);
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::apply_wrap3<
typename Parameters::binding
, Keyword
, Default
, ::boost::mpl::false_
>::type type;
BOOST_MPL_ASSERT((
typename ::boost::mpl::eval_if<
::boost::is_same
, ::boost::mpl::if_<
::boost::is_same
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::true_
>::type
));
#endif // BOOST_PARAMETER_CAN_USE_MP11
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template
struct value_type1
{
using type = ::boost::mp11::mp_apply_q<
Placeholder
, ::boost::mp11::mp_list
>;
static_assert(
::boost::mp11::mp_if<
::std::is_same
, ::boost::mp11::mp_if<
::std::is_same
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_true
>::value
, "required parameters must not result in void_ type"
);
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}} // namespace boost::parameter
#include
namespace boost { namespace parameter {
template <
typename Parameters
, typename Keyword
, typename Default = ::boost::parameter::void_
>
struct value_type
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mpl::eval_if<
::boost::parameter::aux::is_mpl_placeholder
, ::boost::mpl::identity
, ::boost::parameter::value_type0
>
#endif
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = typename ::boost::mp11::mp_if<
::boost::parameter::aux::is_mpl_placeholder
, ::boost::mp11::mp_identity
, ::boost::mp11::mp_if<
::boost::parameter::aux::is_mp11_placeholder
, ::boost::parameter::value_type1
, ::boost::parameter::value_type0
>
>::type;
#endif
};
}} // namespace boost::parameter
#include
namespace boost { namespace parameter {
// A metafunction that, given an argument pack, returns the value type
// of the parameter identified by the given keyword. If no such parameter
// has been specified, returns the type returned by invoking DefaultFn
template
struct lazy_value_type
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_apply_q<
typename Parameters::binding
, ::boost::mp11::mp_list<
Keyword
, typename ::boost::parameter::aux::result_of0::type
, ::boost::mp11::mp_false
>
>;
#else
typedef typename ::boost::mpl::apply_wrap3<
typename Parameters::binding
, Keyword
, typename ::boost::parameter::aux::result_of0::type
, ::boost::mpl::false_
>::type type;
#endif // BOOST_PARAMETER_CAN_USE_MP11
};
}} // namespace boost::parameter
#endif // include guard