Added thirdparty: boost library

This commit is contained in:
Viacheslav Demydiuk
2024-01-06 19:55:56 +02:00
parent bf49f439e1
commit bccd1e7051
15683 changed files with 3239840 additions and 0 deletions
@@ -0,0 +1,32 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_AS_PARAMETER_REQUIREMENTS_HPP
#define BOOST_PARAMETER_AUX_PACK_AS_PARAMETER_REQUIREMENTS_HPP
#include <boost/parameter/aux_/pack/parameter_requirements.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/aux_/pack/predicate.hpp>
#include <boost/parameter/deduced.hpp>
namespace boost { namespace parameter { namespace aux {
// Converts a ParameterSpec into a specialization of
// parameter_requirements. We need to do this in order to get the
// tag_type into the type in a way that can be conveniently matched
// by a satisfies(...) member function in arg_list.
template <typename ParameterSpec>
struct as_parameter_requirements
{
typedef ::boost::parameter::aux::parameter_requirements<
typename ::boost::parameter::aux::tag_type<ParameterSpec>::type
, typename ::boost::parameter::aux::predicate<ParameterSpec>::type
, ::boost::parameter::aux::has_default<ParameterSpec>
> type;
};
}}} // namespace boost::parameter::aux
#endif // include guard
+217
View File
@@ -0,0 +1,217 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_DEDUCE_TAG_HPP
#define BOOST_PARAMETER_AUX_PACK_DEDUCE_TAG_HPP
namespace boost { namespace parameter { namespace aux {
template <
typename Argument
, typename ArgumentPack
, typename DeducedArgs
, typename UsedArgs
, typename TagFn
, typename EmitsErrors
>
struct deduce_tag;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/lambda_tag.hpp>
#include <boost/parameter/config.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/lambda.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Argument, typename ArgumentPack>
struct deduce_tag_condition_mpl
: ::boost::mpl::apply_wrap2<
typename ::boost::mpl::lambda<
Predicate
, ::boost::parameter::aux::lambda_tag
>::type
, Argument
, ArgumentPack
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/has_nested_template_fn.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Argument, typename ArgumentPack>
struct deduce_tag_condition_mp11
{
using type = ::boost::mp11::mp_apply_q<
Predicate
, ::boost::mp11::mp_list<Argument,ArgumentPack>
>;
};
template <typename Predicate, typename Argument, typename ArgumentPack>
using deduce_tag_condition = ::boost::mp11::mp_if<
::boost::parameter::aux::has_nested_template_fn<Predicate>
, ::boost::parameter::aux
::deduce_tag_condition_mp11<Predicate,Argument,ArgumentPack>
, ::boost::parameter::aux
::deduce_tag_condition_mpl<Predicate,Argument,ArgumentPack>
>;
}}} // namespace boost::parameter::aux
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/assert.hpp>
#endif // BOOST_PARAMETER_CAN_USE_MP11
#include <boost/parameter/aux_/set.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/aux_/pack/tag_deduced.hpp>
namespace boost { namespace parameter { namespace aux {
// Helper for deduce_tag<...>, below.
template <
typename Argument
, typename ArgumentPack
, typename DeducedArgs
, typename UsedArgs
, typename TagFn
, typename EmitsErrors
>
class deduce_tag0
{
typedef typename DeducedArgs::spec _spec;
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::parameter::aux::deduce_tag_condition<
typename _spec::predicate
#else
typedef typename ::boost::mpl::apply_wrap2<
typename ::boost::mpl::lambda<
typename _spec::predicate
, ::boost::parameter::aux::lambda_tag
>::type
#endif
, Argument
, ArgumentPack
>::type _condition;
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
// Deduced parameter matches several arguments.
BOOST_MPL_ASSERT((
typename ::boost::mpl::eval_if<
typename ::boost::parameter::aux::has_key_<
UsedArgs
, typename ::boost::parameter::aux::tag_type<_spec>::type
>::type
, ::boost::mpl::eval_if<
_condition
, ::boost::mpl::if_<
EmitsErrors
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::true_
>
, ::boost::mpl::true_
>::type
));
#endif // BOOST_PARAMETER_CAN_USE_MP11
public:
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = typename ::boost::mp11::mp_if<
#else
typedef typename ::boost::mpl::eval_if<
#endif
_condition
, ::boost::parameter::aux
::tag_deduced<UsedArgs,_spec,Argument,TagFn>
, ::boost::parameter::aux::deduce_tag<
Argument
, ArgumentPack
, typename DeducedArgs::tail
, UsedArgs
, TagFn
, EmitsErrors
>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>::type;
#else
>::type type;
#endif
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else
#include <boost/mpl/pair.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Tries to deduced a keyword tag for a given Argument.
// Returns an mpl::pair<> consisting of the tagged_argument<>,
// and an mpl::set<> where the new tag has been inserted.
//
// Argument: The argument type to be tagged.
//
// ArgumentPack: The ArgumentPack built so far.
//
// DeducedArgs: A specialization of deduced_item<> (see below).
// A list containing only the deduced ParameterSpecs.
//
// UsedArgs: An mpl::set<> containing the keyword tags used so far.
//
// TagFn: A metafunction class used to tag positional or deduced
// arguments with a keyword tag.
template <
typename Argument
, typename ArgumentPack
, typename DeducedArgs
, typename UsedArgs
, typename TagFn
, typename EmitsErrors
>
struct deduce_tag
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
::std::is_same<DeducedArgs,::boost::parameter::void_>
, ::boost::mp11::mp_identity<
::boost::mp11::mp_list< ::boost::parameter::void_,UsedArgs>
>
#else
: ::boost::mpl::eval_if<
::boost::is_same<DeducedArgs,::boost::parameter::void_>
, ::boost::mpl::pair< ::boost::parameter::void_,UsedArgs>
#endif
, ::boost::parameter::aux::deduce_tag0<
Argument
, ArgumentPack
, DeducedArgs
, UsedArgs
, TagFn
, EmitsErrors
>
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard
+34
View File
@@ -0,0 +1,34 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_DEDUCED_ITEM_HPP
#define BOOST_PARAMETER_AUX_PACK_DEDUCED_ITEM_HPP
#include <boost/parameter/aux_/void.hpp>
namespace boost { namespace parameter { namespace aux {
// A typelist that stored deduced parameter specs.
template <
typename ParameterSpec
, typename Tail = ::boost::parameter::void_
>
struct deduced_item
{
typedef ParameterSpec spec;
typedef Tail tail;
};
// Evaluate Tail and construct deduced_item list.
template <typename Spec, typename Tail>
struct make_deduced_item
{
typedef ::boost::parameter::aux
::deduced_item<Spec,typename Tail::type> type;
};
}}} // namespace boost::parameter::aux
#endif // include guard
+23
View File
@@ -0,0 +1,23 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_INSERT_TAGGED_HPP
#define BOOST_PARAMETER_AUX_PACK_INSERT_TAGGED_HPP
#include <boost/parameter/aux_/set.hpp>
namespace boost { namespace parameter { namespace aux {
// Inserts Tagged::key_type into the UserArgs set.
// Extra indirection to lazily evaluate Tagged::key_type.
template <typename UsedArgs, typename Tagged>
struct insert_tagged
: ::boost::parameter::aux::insert_<UsedArgs,typename Tagged::key_type>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard
+43
View File
@@ -0,0 +1,43 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_IS_NAMED_ARGUMENT_HPP
#define BOOST_PARAMETER_AUX_PACK_IS_NAMED_ARGUMENT_HPP
#include <boost/parameter/aux_/template_keyword.hpp>
#include <boost/parameter/aux_/is_tagged_argument.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using is_named_argument = ::boost::mp11::mp_if<
::boost::parameter::aux::is_template_keyword<T>
, ::boost::mp11::mp_true
, ::boost::parameter::aux::is_tagged_argument_mp11<T>
>;
#else
struct is_named_argument
: ::boost::mpl::if_<
::boost::parameter::aux::is_template_keyword<T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_tagged_argument<T>
>::type
{
};
#endif
}}} // namespace boost::parameter::aux
#endif // include guard
+47
View File
@@ -0,0 +1,47 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_ITEM_HPP
#define BOOST_PARAMETER_AUX_PACK_ITEM_HPP
#include <boost/parameter/aux_/void.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// A parameter spec item typelist.
template <
typename Spec
, typename Arg
, typename Tail = ::boost::parameter::void_
>
struct item
{
typedef Spec spec;
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
typedef ::boost::is_const<
typename ::boost::remove_reference<Arg>::type
> is_arg_const;
#endif
typedef Arg arg;
typedef Tail tail;
};
template <typename Spec, typename Arg, typename Tail>
struct make_item
{
typedef boost::parameter::aux
::item<Spec,Arg,typename Tail::type> type;
};
}}} // namespace boost::parameter::aux
#endif // include guard
+438
View File
@@ -0,0 +1,438 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// Copyright Cromwell D. Enage 2018.
// 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_AUX_PACK_MAKE_ARG_LIST_HPP
#define BOOST_PARAMETER_AUX_PACK_MAKE_ARG_LIST_HPP
namespace boost { namespace parameter { namespace aux {
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename IsPositional
, typename UsedArgs
, typename ArgumentPack
, typename Error
, typename EmitsErrors
>
struct make_arg_list_aux;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/arg_list.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/pack/unmatched_argument.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/aux_/pack/is_named_argument.hpp>
#include <boost/parameter/aux_/pack/insert_tagged.hpp>
#include <boost/parameter/aux_/pack/deduce_tag.hpp>
#include <boost/parameter/deduced.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename ArgumentPack, typename TaggedArg, typename EmitsErrors>
struct append_to_make_arg_list
{
using type = ::boost::mp11::mp_push_front<
ArgumentPack
, ::boost::parameter::aux::flat_like_arg_tuple<
typename TaggedArg::key_type
, TaggedArg
, EmitsErrors
>
>;
};
#endif
// Borland needs the insane extra-indirection workaround below so that
// it doesn't magically drop the const qualifier from the argument type.
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename IsPositional
, typename UsedArgs
, typename ArgumentPack
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
, typename _argument
#endif
, typename Error
, typename EmitsErrors
>
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
class make_arg_list00
#else
class make_arg_list0
#endif
{
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
typedef typename List::arg _argument;
#endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _arg_type = typename ::std::remove_const<
typename ::std::remove_reference<_argument>::type
>::type;
using _is_tagged = ::boost::parameter::aux
::is_named_argument<_argument>;
#else
typedef typename ::boost::remove_const<
typename ::boost::remove_reference<_argument>::type
>::type _arg_type;
typedef ::boost::parameter::aux
::is_named_argument<_argument> _is_tagged;
#endif
typedef typename List::spec _parameter_spec;
typedef typename ::boost::parameter::aux
::tag_type<_parameter_spec>::type _tag;
// If this argument is either explicitly tagged or a deduced
// parameter, then turn off positional matching.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _is_positional = ::boost::mp11::mp_if<
IsPositional
, ::boost::mp11::mp_if<
::boost::parameter::aux::is_deduced<_parameter_spec>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_if<
_is_tagged
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
>
, ::boost::mp11::mp_false
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::eval_if<
IsPositional
, ::boost::mpl::eval_if<
::boost::parameter::aux::is_deduced<_parameter_spec>
, ::boost::mpl::false_
, ::boost::mpl::if_<
_is_tagged
, ::boost::mpl::false_
, ::boost::mpl::true_
>
>
, ::boost::mpl::false_
>::type _is_positional;
#endif // BOOST_PARAMETER_CAN_USE_MP11
// If this parameter is explicitly tagged, then add it to the
// used-parmeters set. We only really need to add parameters
// that are deduced, but we would need a way to check if
// a given tag corresponds to a deduced parameter spec.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _used_args = typename ::boost::mp11::mp_if<
_is_tagged
, ::boost::parameter::aux::insert_tagged<UsedArgs,_arg_type>
, ::boost::mp11::mp_identity<UsedArgs>
>::type;
#else
typedef typename ::boost::mpl::eval_if<
_is_tagged
, ::boost::parameter::aux::insert_tagged<UsedArgs,_arg_type>
, ::boost::mpl::identity<UsedArgs>
>::type _used_args;
#endif
// If this parameter is neither explicitly tagged nor positionally
// matched, then deduce the tag from the deduced parameter specs.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _deduced_data = typename ::boost::mp11::mp_if<
::boost::mp11::mp_if<
_is_tagged
, ::boost::mp11::mp_true
, _is_positional
>
, ::boost::mp11::mp_identity<
::boost::mp11::mp_list< ::boost::parameter::void_,_used_args>
>
#else
typedef typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
_is_tagged
, ::boost::mpl::true_
, _is_positional
>::type
, ::boost::mpl::pair< ::boost::parameter::void_,_used_args>
#endif
, ::boost::parameter::aux::deduce_tag<
_argument
, ArgumentPack
, DeducedArgs
, _used_args
, TagFn
, EmitsErrors
>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>::type;
#else
>::type _deduced_data;
#endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
// If this parameter is explicitly tagged ...
using _tagged = ::boost::mp11::mp_if<
_is_tagged
// ... just use it
, _arg_type
// ... else ...
, ::boost::mp11::mp_if<
// if positional matching is turned on ...
_is_positional
// ... tag it positionally
, ::boost::mp11::mp_apply_q<
TagFn
, ::boost::mp11::mp_list<_tag,_argument>
>
// ... else, use the deduced tag
, ::boost::mp11::mp_at_c<_deduced_data,0>
>
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
// If this parameter is explicitly tagged ...
typedef typename ::boost::mpl::eval_if<
_is_tagged
// ... just use it
, ::boost::mpl::identity<_arg_type>
// ... else ...
, ::boost::mpl::eval_if<
// if positional matching is turned on ...
_is_positional
// ... tag it positionally
, ::boost::mpl::apply_wrap2<TagFn,_tag,_argument>
// ... else, use the deduced tag
, ::boost::mpl::first<_deduced_data>
>
>::type _tagged;
#endif // BOOST_PARAMETER_CAN_USE_MP11
// Build the arg_list incrementally, prepending new nodes.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _error = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::std::is_same<Error,::boost::parameter::void_>
, ::std::is_same<_tagged,::boost::parameter::void_>
, ::boost::mp11::mp_false
>
#else
typedef typename ::boost::mpl::if_<
typename ::boost::mpl::if_<
::boost::is_same<Error,::boost::parameter::void_>
, ::boost::is_same<_tagged,::boost::parameter::void_>
, ::boost::mpl::false_
>::type
#endif
, ::boost::parameter::aux::unmatched_argument<_argument>
, ::boost::parameter::void_
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>;
#else
>::type _error;
#endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _argument_pack = typename ::boost::mp11::mp_if<
::std::is_same<_tagged,::boost::parameter::void_>
, ::boost::mp11::mp_identity<ArgumentPack>
, ::boost::parameter::aux
::append_to_make_arg_list<ArgumentPack,_tagged,EmitsErrors>
>::type;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::if_<
::boost::is_same<_tagged,::boost::parameter::void_>
, ArgumentPack
#if defined(BOOST_NO_SFINAE) || BOOST_WORKAROUND(BOOST_MSVC, < 1800)
, ::boost::parameter::aux::arg_list<_tagged,ArgumentPack>
#else
, ::boost::parameter::aux
::arg_list<_tagged,ArgumentPack,EmitsErrors>
#endif
>::type _argument_pack;
#endif // BOOST_PARAMETER_CAN_USE_MP11
public:
typedef typename ::boost::parameter::aux::make_arg_list_aux<
typename List::tail
, DeducedArgs
, TagFn
, _is_positional
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_at_c<_deduced_data,1>
#else
, typename _deduced_data::second
#endif
, _argument_pack
, _error
, EmitsErrors
>::type type;
};
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename IsPositional
, typename UsedArgs
, typename ArgumentPack
, typename Error
, typename EmitsErrors
>
struct make_arg_list0
{
typedef typename ::boost::mpl::eval_if<
typename List::is_arg_const
, ::boost::parameter::aux::make_arg_list00<
List
, DeducedArgs
, TagFn
, IsPositional
, UsedArgs
, ArgumentPack
, typename List::arg const
, Error
, EmitsErrors
>
, ::boost::parameter::aux::make_arg_list00<
List
, DeducedArgs
, TagFn
, IsPositional
, UsedArgs
, ArgumentPack
, typename List::arg
, Error
, EmitsErrors
>
>::type type;
};
#endif // Borland workarounds needed.
// Returns an ArgumentPack where the list of arguments has been tagged
// with keyword tags.
//
// List: A specialization of item<> (see below). Contains both
// the ordered ParameterSpecs, and the given arguments.
//
// DeducedArgs: A specialization of deduced_item<> (see below).
// A list containing only the deduced ParameterSpecs.
//
// TagFn: A metafunction class used to tag positional or deduced
// arguments with a keyword tag.
//
// IsPositional: An mpl::bool_<> specialization indicating if positional
// matching is to be performed.
//
// DeducedSet: An mpl::set<> containing the keyword tags used so far.
//
// ArgumentPack: The ArgumentPack built so far. This is initially an
// empty_arg_list and is built incrementally.
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename IsPositional
, typename DeducedSet
, typename ArgumentPack
, typename Error
, typename EmitsErrors
>
struct make_arg_list_aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
::std::is_same<List,::boost::parameter::void_>
, ::boost::mp11::mp_identity<
::boost::mp11::mp_list<ArgumentPack,Error>
>
#else
: ::boost::mpl::eval_if<
::boost::is_same<List,::boost::parameter::void_>
, ::boost::mpl::identity< ::boost::mpl::pair<ArgumentPack,Error> >
#endif
, ::boost::parameter::aux::make_arg_list0<
List
, DeducedArgs
, TagFn
, IsPositional
, DeducedSet
, ArgumentPack
, Error
, EmitsErrors
>
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/set.hpp>
namespace boost { namespace parameter { namespace aux {
// VC6.5 was choking on the default parameters for make_arg_list_aux,
// so this just forwards to that adding in the defaults.
template <
typename List
, typename DeducedArgs
, typename TagFn
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, typename EmitsErrors = ::boost::mp11::mp_true
#else
, typename EmitsErrors = ::boost::mpl::true_
#endif
>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using make_arg_list = ::boost::parameter::aux::make_arg_list_aux<
#else
struct make_arg_list
: ::boost::parameter::aux::make_arg_list_aux<
#endif
List
, DeducedArgs
, TagFn
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_true
#else
, ::boost::mpl::true_
#endif
, ::boost::parameter::aux::set0
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::parameter::aux::flat_like_arg_list<>
#else
, ::boost::parameter::aux::empty_arg_list
#endif
, ::boost::parameter::void_
, EmitsErrors
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>;
#else
>
{
};
#endif
}}} // namespace boost::parameter::aux
#endif // include guard
+53
View File
@@ -0,0 +1,53 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_MAKE_DEDUCED_ITEMS_HPP
#define BOOST_PARAMETER_AUX_PACK_MAKE_DEDUCED_ITEMS_HPP
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/pack/deduced_item.hpp>
#include <boost/parameter/deduced.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Spec, typename Tail>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using make_deduced_items = ::boost::mp11::mp_if<
::std::is_same<Spec,::boost::parameter::void_>
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
, ::boost::mp11::mp_if<
::boost::parameter::aux::is_deduced<Spec>
, ::boost::parameter::aux::make_deduced_item<Spec,Tail>
, Tail
>
>;
#else
struct make_deduced_items
: ::boost::mpl::eval_if<
::boost::is_same<Spec,::boost::parameter::void_>
, ::boost::mpl::identity< ::boost::parameter::void_>
, ::boost::mpl::eval_if<
::boost::parameter::aux::is_deduced<Spec>
, ::boost::parameter::aux::make_deduced_item<Spec,Tail>
, Tail
>
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#endif // include guard
+45
View File
@@ -0,0 +1,45 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_MAKE_ITEMS_HPP
#define BOOST_PARAMETER_AUX_PACK_MAKE_ITEMS_HPP
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/pack/item.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Creates a item typelist.
template <typename Spec, typename Arg, typename Tail>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using make_items = ::boost::mp11::mp_if<
::std::is_same<Arg,::boost::parameter::void_>
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
, ::boost::parameter::aux::make_item<Spec,Arg,Tail>
>;
#else
struct make_items
: ::boost::mpl::eval_if<
::boost::is_same<Arg,::boost::parameter::void_>
, ::boost::mpl::identity< ::boost::parameter::void_>
, ::boost::parameter::aux::make_item<Spec,Arg,Tail>
>
{
};
#endif
}}} // namespace boost::parameter::aux
#endif // include guard
@@ -0,0 +1,244 @@
// Copyright Cromwell D. Enage 2017.
// 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_AUX_PACK_MAKE_PARAMETER_SPEC_ITEMS_HPP
#define BOOST_PARAMETER_AUX_PACK_MAKE_PARAMETER_SPEC_ITEMS_HPP
namespace boost { namespace parameter { namespace aux {
// This recursive metafunction forwards successive elements of
// parameters::parameter_spec to make_deduced_items<>.
// -- Cromwell D. Enage
template <typename SpecSeq>
struct make_deduced_list;
// Helper for match_parameters_base_cond<...>, below.
template <typename ArgumentPackAndError, typename SpecSeq>
struct match_parameters_base_cond_helper;
// Helper metafunction for make_parameter_spec_items<...>, below.
template <typename SpecSeq, typename ...Args>
struct make_parameter_spec_items_helper;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename SpecSeq>
struct make_parameter_spec_items_helper<SpecSeq>
{
typedef ::boost::parameter::void_ type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/pack/make_deduced_items.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/list.hpp>
#else
#include <boost/mpl/front.hpp>
#include <boost/mpl/pop_front.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename SpecSeq>
struct make_deduced_list_not_empty
: ::boost::parameter::aux::make_deduced_items<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_front<SpecSeq>
#else
typename ::boost::mpl::front<SpecSeq>::type
#endif
, ::boost::parameter::aux::make_deduced_list<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_pop_front<SpecSeq>
#else
typename ::boost::mpl::pop_front<SpecSeq>::type
#endif
>
>
{
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/empty.hpp>
#include <boost/mpl/identity.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename SpecSeq>
struct make_deduced_list
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
::boost::mp11::mp_empty<SpecSeq>
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
#else
: ::boost::mpl::eval_if<
::boost::mpl::empty<SpecSeq>
, ::boost::mpl::identity< ::boost::parameter::void_>
#endif
, ::boost::parameter::aux::make_deduced_list_not_empty<SpecSeq>
>
{
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename ArgumentPackAndError>
struct is_arg_pack_error_void
: ::boost::mpl::if_<
::boost::is_same<
typename ::boost::mpl::second<ArgumentPackAndError>::type
, ::boost::parameter::void_
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
namespace boost { namespace parameter { namespace aux {
// Checks if the arguments match the criteria of overload resolution.
// If NamedList satisfies the PS0, PS1, ..., this is a metafunction
// returning parameters. Otherwise it has no nested ::type.
template <typename ArgumentPackAndError, typename SpecSeq>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using match_parameters_base_cond = ::boost::mp11::mp_if<
::boost::mp11::mp_empty<SpecSeq>
, ::std::is_same<
::boost::mp11::mp_at_c<ArgumentPackAndError,1>
, ::boost::parameter::void_
>
, ::boost::parameter::aux::match_parameters_base_cond_helper<
ArgumentPackAndError
, SpecSeq
>
>;
#else
struct match_parameters_base_cond
: ::boost::mpl::eval_if<
::boost::mpl::empty<SpecSeq>
, ::boost::parameter::aux
::is_arg_pack_error_void<ArgumentPackAndError>
, ::boost::parameter::aux::match_parameters_base_cond_helper<
ArgumentPackAndError
, SpecSeq
>
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/pack/satisfies.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename ArgumentPackAndError, typename SpecSeq>
struct match_parameters_base_cond_helper
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
#else
: ::boost::mpl::eval_if<
#endif
::boost::parameter::aux::satisfies_requirements_of<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_at_c<ArgumentPackAndError,0>
, ::boost::mp11::mp_front<SpecSeq>
#else
typename ::boost::mpl::first<ArgumentPackAndError>::type
, typename ::boost::mpl::front<SpecSeq>::type
#endif
>
, ::boost::parameter::aux::match_parameters_base_cond<
ArgumentPackAndError
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_pop_front<SpecSeq>
#else
, typename ::boost::mpl::pop_front<SpecSeq>::type
#endif
>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_false
#else
, ::boost::mpl::false_
#endif
>
{
};
// This parameters item chaining metafunction class does not require
// the lengths of the SpecSeq and of Args parameter pack to match.
// Used by argument_pack to build the items in the resulting arg_list.
// -- Cromwell D. Enage
template <typename SpecSeq, typename ...Args>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using make_parameter_spec_items = ::boost::mp11::mp_if<
::boost::mp11::mp_empty<SpecSeq>
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
, ::boost::parameter::aux
::make_parameter_spec_items_helper<SpecSeq,Args...>
>;
#else
struct make_parameter_spec_items
: ::boost::mpl::eval_if<
::boost::mpl::empty<SpecSeq>
, ::boost::mpl::identity< ::boost::parameter::void_>
, ::boost::parameter::aux
::make_parameter_spec_items_helper<SpecSeq,Args...>
>
{
};
#endif
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/pack/make_items.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename SpecSeq, typename A0, typename ...Args>
struct make_parameter_spec_items_helper<SpecSeq,A0,Args...>
: ::boost::parameter::aux::make_items<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_front<SpecSeq>
#else
typename ::boost::mpl::front<SpecSeq>::type
#endif
, A0
, ::boost::parameter::aux::make_parameter_spec_items<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_pop_front<SpecSeq>
#else
typename ::boost::mpl::pop_front<SpecSeq>::type
#endif
, Args...
>
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard
+25
View File
@@ -0,0 +1,25 @@
// Copyright Daniel Wallin, David Abrahams 2005.
// 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_AUX_PACK_PARAMETER_REQUIREMENTS_HPP
#define BOOST_PARAMETER_AUX_PACK_PARAMETER_REQUIREMENTS_HPP
namespace boost { namespace parameter { namespace aux {
// Used to pass static information about parameter requirements through
// the satisfies() overload set (below). The matched function is never
// invoked, but its type indicates whether a parameter matches at
// compile-time.
template <typename Keyword, typename Predicate, typename HasDefault>
struct parameter_requirements
{
typedef Keyword keyword;
typedef Predicate predicate;
typedef HasDefault has_default;
};
}}} // namespace boost::parameter::aux
#endif // include guard
+87
View File
@@ -0,0 +1,87 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_PREDICATE_HPP
#define BOOST_PARAMETER_AUX_PACK_PREDICATE_HPP
namespace boost { namespace parameter { namespace aux {
// helper for get_predicate<...>, below
template <typename T>
struct get_predicate_or_default
{
typedef T type;
};
// helper for predicate<...>, below
template <typename T>
struct get_predicate
: ::boost::parameter::aux
::get_predicate_or_default<typename T::predicate>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/use_default.hpp>
#include <boost/parameter/aux_/always_true_predicate.hpp>
namespace boost { namespace parameter { namespace aux {
template <>
struct get_predicate_or_default< ::boost::parameter::aux::use_default>
{
typedef ::boost::parameter::aux::always_true_predicate type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using predicate = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::boost::parameter::aux::is_optional<T>
, ::boost::mp11::mp_true
, ::boost::parameter::aux::is_required<T>
>
, ::boost::parameter::aux::get_predicate<T>
, ::boost::mp11::mp_identity<
::boost::parameter::aux::always_true_predicate
>
>;
#else
struct predicate
: ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::parameter::aux::is_optional<T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_required<T>
>::type
, ::boost::parameter::aux::get_predicate<T>
, ::boost::mpl::identity<
::boost::parameter::aux::always_true_predicate
>
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#endif // include guard
+142
View File
@@ -0,0 +1,142 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_SATISFIES_HPP
#define BOOST_PARAMETER_AUX_PACK_SATISFIES_HPP
#include <boost/parameter/config.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
#include <boost/parameter/aux_/arg_list.hpp>
#include <boost/parameter/aux_/augment_predicate.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/type_traits/is_same.hpp>
#else // !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#else
#include <boost/mpl/bool.hpp>
#endif
#include <boost/parameter/aux_/yesno.hpp>
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
#endif // MSVC-7.1 workarounds needed
namespace boost { namespace parameter { namespace aux {
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
template <typename ArgList, typename ParameterRequirements, typename Bound>
struct satisfies_impl
: ::boost::parameter::aux::augment_predicate<
typename ParameterRequirements::predicate
, typename ArgList::reference
, typename ArgList::key_type
, Bound
, ArgList
>
{
};
#endif
// Returns mpl::true_ iff the given ParameterRequirements are satisfied by
// ArgList.
template <typename ArgList, typename ParameterRequirements>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using satisfies = ::boost::mp11::mp_bool<
sizeof(
::boost::parameter::aux::to_yesno(
ArgList::satisfies(
static_cast<ParameterRequirements*>(
BOOST_PARAMETER_AUX_PP_NULLPTR
)
, static_cast<ArgList*>(BOOST_PARAMETER_AUX_PP_NULLPTR)
)
)
) == sizeof(::boost::parameter::aux::yes_tag)
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
class satisfies
{
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
// VC7.1 can't handle the sizeof() implementation below,
// so we use this instead.
typedef typename ::boost::mpl::apply_wrap3<
typename ArgList::binding
, typename ParameterRequirements::keyword
, ::boost::parameter::void_
, ::boost::mpl::false_
>::type _bound;
public:
typedef typename ::boost::mpl::eval_if<
::boost::is_same<_bound,::boost::parameter::void_>
, typename ParameterRequirements::has_default
, ::boost::mpl::eval_if<
::boost::is_same<
ArgList
, ::boost::parameter::aux::empty_arg_list
>
, ::boost::mpl::false_
, ::boost::parameter::aux::satisfies_impl<
ArgList
, ParameterRequirements
, _bound
>
>
>::type type;
#else // !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
BOOST_STATIC_CONSTANT(
bool, _value = (
sizeof(
::boost::parameter::aux::to_yesno(
ArgList::satisfies(
static_cast<ParameterRequirements*>(
BOOST_PARAMETER_AUX_PP_NULLPTR
)
, static_cast<ArgList*>(BOOST_PARAMETER_AUX_PP_NULLPTR)
)
)
) == sizeof(::boost::parameter::aux::yes_tag)
)
);
public:
typedef ::boost::mpl::bool_<
::boost::parameter::aux
::satisfies<ArgList,ParameterRequirements>::_value
> type;
#endif // MSVC-7.1 workarounds needed
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/pack/as_parameter_requirements.hpp>
namespace boost { namespace parameter { namespace aux {
// Returns mpl::true_ if the requirements of the given ParameterSpec
// are satisfied by ArgList.
template <typename ArgList, typename ParameterSpec>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using satisfies_requirements_of = ::boost::parameter::aux::satisfies<
ArgList
, typename ::boost::parameter::aux
::as_parameter_requirements<ParameterSpec>::type
>;
#else
struct satisfies_requirements_of
: ::boost::parameter::aux::satisfies<
ArgList
, typename ::boost::parameter::aux
::as_parameter_requirements<ParameterSpec>::type
>::type
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#endif // include guard
+59
View File
@@ -0,0 +1,59 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_TAG_DEDUCED_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_DEDUCED_HPP
#include <boost/parameter/aux_/set.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/pair.hpp>
#include <boost/mpl/apply_wrap.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Tags a deduced argument Arg with the keyword tag of Spec using TagFn.
// Returns the tagged argument and the mpl::set<> UsedArgs with the
// tag of Spec inserted.
template <typename UsedArgs, typename Spec, typename Arg, typename TagFn>
struct tag_deduced
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_list<
::boost::mp11::mp_apply_q<
TagFn
, ::boost::mp11::mp_list<
typename ::boost::parameter::aux::tag_type<Spec>::type
, Arg
>
>
#else
typedef ::boost::mpl::pair<
typename ::boost::mpl::apply_wrap2<
TagFn
, typename ::boost::parameter::aux::tag_type<Spec>::type
, Arg
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, typename ::boost::parameter::aux::insert_<
UsedArgs
, typename ::boost::parameter::aux::tag_type<Spec>::type
>::type
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>;
#else
> type;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard
+30
View File
@@ -0,0 +1,30 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_TAG_KEYWORD_ARG_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_HPP
#include <boost/parameter/aux_/tag.hpp>
#include <boost/parameter/config.hpp>
namespace boost { namespace parameter { namespace aux {
struct tag_keyword_arg
{
template <typename K, typename T>
struct apply
{
typedef typename ::boost::parameter::aux::tag<K,T>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename K, typename T>
using fn = typename ::boost::parameter::aux::tag<K,T>::type;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard
+67
View File
@@ -0,0 +1,67 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_TAG_KEYWORD_ARG_REF_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_REF_HPP
#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
#include <boost/parameter/aux_/tagged_argument.hpp>
#include <boost/parameter/config.hpp>
namespace boost { namespace parameter { namespace aux {
template <
typename Keyword
, typename ActualArg
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
, typename = typename ::boost::parameter::aux
::is_cv_reference_wrapper<ActualArg>::type
#endif
>
struct tag_ref
{
typedef ::boost::parameter::aux::tagged_argument<
Keyword
, typename ::boost::parameter::aux
::unwrap_cv_reference<ActualArg>::type
> type;
};
}}} // namespace boost::parameter::aux_
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/mpl/bool.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Keyword, typename ActualArg>
struct tag_ref<Keyword,ActualArg,::boost::mpl::false_>
{
typedef ::boost::parameter::aux
::tagged_argument<Keyword,ActualArg> type;
};
}}} // namespace boost::parameter::aux_
#endif // Borland workarounds needed.
namespace boost { namespace parameter { namespace aux {
struct tag_keyword_arg_ref
{
template <typename K, typename T>
struct apply
{
typedef typename ::boost::parameter::aux::tag_ref<K,T>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename K, typename T>
using fn = typename ::boost::parameter::aux::tag_ref<K,T>::type;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard
@@ -0,0 +1,30 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_TAG_TEMPLATE_KEYWORD_ARG_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_TEMPLATE_KEYWORD_ARG_HPP
#include <boost/parameter/template_keyword.hpp>
#include <boost/parameter/config.hpp>
namespace boost { namespace parameter { namespace aux {
struct tag_template_keyword_arg
{
template <typename K, typename T>
struct apply
{
typedef ::boost::parameter::template_keyword<K,T> type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename K, typename T>
using fn = ::boost::parameter::template_keyword<K,T>;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard
+89
View File
@@ -0,0 +1,89 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_TAG_TYPE_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
namespace boost { namespace parameter { namespace aux {
// helper for tag_type<...>, below.
template <typename T>
struct get_tag_type0
{
typedef typename T::key_type type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/deduced.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/eval_if.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct get_tag_type
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
#else
: ::boost::mpl::eval_if<
#endif
::boost::parameter::aux::is_deduced0<T>
, ::boost::parameter::aux::get_tag_type0<typename T::key_type>
, ::boost::parameter::aux::get_tag_type0<T>
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
using tag_type = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::boost::parameter::aux::is_optional<T>
, ::boost::mp11::mp_true
, ::boost::parameter::aux::is_required<T>
>
, ::boost::parameter::aux::get_tag_type<T>
, ::boost::mp11::mp_identity<T>
>;
}}} // namespace boost::parameter::aux
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct tag_type
: ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::parameter::aux::is_optional<T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_required<T>
>::type
, ::boost::parameter::aux::get_tag_type<T>
, ::boost::mpl::identity<T>
>
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard
+41
View File
@@ -0,0 +1,41 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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_AUX_PACK_UNMATCHED_ARGUMENT_HPP
#define BOOST_PARAMETER_AUX_PACK_UNMATCHED_ARGUMENT_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct unmatched_argument
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
static_assert(::std::is_same<T,void>::value, "T == void");
#else
BOOST_MPL_ASSERT((
typename ::boost::mpl::if_<
::boost::is_same<T,void>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
));
#endif
typedef int type;
};
}}} // namespace boost::parameter::aux
#endif // include guard