Merge with boostorg/parameter

This commit is contained in:
Cromwell D. Enage
2018-10-25 05:55:34 -04:00
committed by GitHub
62 changed files with 3622 additions and 2405 deletions

View File

@@ -533,14 +533,15 @@ template &lt;class A0, …class Aβ&gt; <a class="reference internal" href="#arg
<div class="section" id="optional-required">
<span id="required"></span><span id="optional"></span><h2><a class="toc-backref" href="#id42">4.3&nbsp;&nbsp;&nbsp;<tt class="docutils literal">optional</tt>, <tt class="docutils literal">required</tt></a></h2>
<p>These templates describe the requirements on a function parameter.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/parameters.hpp">boost/parameter/parameters.hpp</a></td>
</tr>
</tbody>
</table>
<p><tt class="docutils literal">optional</tt> is defined in: <a
class="reference external" href="../../../../boost/parameter/optional.hpp"
>boost/parameter/optional.hpp</a>.</p>
<p><tt class="docutils literal">required</tt> is defined in: <a
class="reference external" href="../../../../boost/parameter/required.hpp"
>boost/parameter/required.hpp</a>.</p>
<p>Both headers are included by: <a class="reference external"
href="../../../../boost/parameter/parameters.hpp"
>boost/parameter/parameters.hpp</a></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
@@ -551,10 +552,10 @@ template &lt;class A0, …class Aβ&gt; <a class="reference internal" href="#arg
</tbody>
</table>
<pre class="literal-block">
template &lt;class Tag, class Predicate = <em>unspecified</em>&gt;
template &lt;typename Tag, typename Predicate = <em>unspecified</em>&gt;
struct optional;
template &lt;class Tag, class Predicate = <em>unspecified</em>&gt;
template &lt;typename Tag, typename Predicate = <em>unspecified</em>&gt;
struct required;
</pre>
<p>The default value of <tt class="docutils literal">Predicate</tt> is an unspecified <a class="reference external" href="../../../mpl/doc/refmanual/metafunction.html"><span class="concept">Metafunction</span></a> that returns
@@ -568,7 +569,17 @@ struct required;
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Defined in:</th><td class="field-body"><a class="reference external" href="../../../../boost/parameter/parameters.hpp">boost/parameter/parameters.hpp</a></td>
<tr class="field">
<th class="field-name">Defined in:</th>
<td class="field-body"><a class="reference external"
href="../../../../boost/parameter/deduced.hpp"
>boost/parameter/deduced.hpp</a></td>
</tr>
<tr class="field">
<th class="field-name">Included by:</th>
<td class="field-body"><a class="reference external"
href="../../../../boost/parameter/parameters.hpp"
>boost/parameter/parameters.hpp</a></td>
</tr>
</tbody>
</table>

View File

@@ -475,9 +475,16 @@ __ ../../../../boost/parameter/parameters.hpp
These templates describe the requirements on a function parameter.
:Defined in: `boost/parameter/parameters.hpp`__
``optional`` is defined in: |optional_header|_
``required`` is defined in: |required_header|_
Both headers are included by: |preprocessor_header|_
__ ../../../../boost/parameter/parameters.hpp
.. |optional_header| replace:: boost/parameter/optional.hpp
.. _optional_header: ../../../../boost/parameter/optional.hpp
.. |required_header| replace:: boost/parameter/required.hpp
.. _required_header: ../../../../boost/parameter/required.hpp
.. |preprocessor_header| replace:: boost/parameter/preprocessor.hpp
.. _preprocessor_header: ../../../../boost/parameter/preprocessor.hpp
:Specializations model: |ParameterSpec|_
@@ -502,9 +509,13 @@ The default value of ``Predicate`` is an unspecified |Metafunction|_ that return
This template is used to wrap the *keyword tag* argument to
``optional`` or ``required``.
:Defined in: `boost/parameter/parameters.hpp`__
:Defined in: |deduced_header|_
:Included by: |preprocessor_header|_
__ ../../../../boost/parameter/parameters.hpp
.. |deduced_header| replace:: boost/parameter/deduced.hpp
.. _deduced_header: ../../../../boost/parameter/deduced.hpp
.. |preprocessor_header| replace:: boost/parameter/preprocessor.hpp
.. _preprocessor_header: ../../../../boost/parameter/preprocessor.hpp
.. parsed-literal::

View File

@@ -12,6 +12,9 @@
#include <boost/parameter/aux_/parameter_requirements.hpp>
#include <boost/parameter/aux_/yesno.hpp>
#include <boost/parameter/aux_/is_maybe.hpp>
#include <boost/parameter/aux_/tagged_argument_fwd.hpp>
#include <boost/parameter/aux_/lambda_tag.hpp>
#include <boost/parameter/keyword_fwd.hpp>
#include <boost/parameter/config.hpp>
#include <boost/mpl/apply.hpp>
@@ -26,15 +29,7 @@
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
namespace boost { namespace parameter {
// Forward declaration for aux::arg_list, below.
template<class T> struct keyword;
namespace aux {
// Tag type passed to MPL lambda.
struct lambda_tag;
namespace boost { namespace parameter { namespace aux {
//
// Structures used to build the tuple of actual arguments. The
@@ -146,10 +141,6 @@ struct empty_arg_list
typedef arg_list_tag tag; // For dispatching to sequence intrinsics
};
// Forward declaration for arg_list::operator,
template <class KW, class T>
struct tagged_argument;
template <class T>
struct get_reference
{

View File

@@ -1,141 +1,12 @@
// Copyright Daniel Wallin 2006. Use, modification and distribution is
// subject to 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)
// 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_CAST_060902_HPP
# define BOOST_PARAMETER_CAST_060902_HPP
#define BOOST_PARAMETER_CAST_060902_HPP
# include <boost/detail/workaround.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_cast.hpp>
# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
# include <boost/type_traits/add_reference.hpp>
# include <boost/type_traits/remove_const.hpp>
# endif
namespace boost { namespace parameter { namespace aux {
struct use_default_tag {};
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
# define BOOST_PARAMETER_FUNCTION_CAST(value, predicate) value
# else
// Handles possible implicit casts. Used by preprocessor.hpp to
// normalize user input.
//
// cast<void*>::execute() is identity
// cast<void*(X)>::execute() is identity
// cast<void(X)>::execute() casts to X
//
// preprocessor.hpp uses this like this:
//
// #define X(value, predicate)
// cast<void predicate>::execute(value)
//
// X(something, *)
// X(something, *(predicate))
// X(something, (int))
template <class T, class Args>
struct cast;
template <class Args>
struct cast<void*, Args>
{
static use_default_tag execute(use_default_tag)
{
return use_default_tag();
}
static use_default_tag remove_const(use_default_tag)
{
return use_default_tag();
}
template <class U>
static U& execute(U& value)
{
return value;
}
template <class U>
static U& remove_const(U& x)
{
return x;
}
};
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
typedef void* voidstar;
template <class T, class Args>
struct cast<voidstar(T), Args>
: cast<void*, Args>
{
};
#else
template <class T, class Args>
struct cast<void*(T), Args>
: cast<void*, Args>
{
};
#endif
// This is a hack used in cast<> to turn the user supplied type,
// which may or may not be a placeholder expression into one, so
// that it will be properly evaluated by mpl::apply.
template <class T, class Dummy = mpl::_1>
struct as_placeholder_expr
{
typedef T type;
};
template <class T, class Args>
struct cast<void(T), Args>
{
typedef typename mpl::apply2<
as_placeholder_expr<T>, Args, Args>::type type0;
typedef typename boost::add_reference<
typename boost::remove_const<type0>::type
>::type reference;
static use_default_tag execute(use_default_tag)
{
return use_default_tag();
}
static use_default_tag remove_const(use_default_tag)
{
return use_default_tag();
}
static type0 execute(type0 value)
{
return value;
}
template <class U>
static reference remove_const(U const& x)
{
return const_cast<reference>(x);
}
};
# define BOOST_PARAMETER_FUNCTION_CAST(value, predicate, args) \
boost::parameter::aux::cast<void predicate, args>::remove_const( \
boost::parameter::aux::cast<void predicate, args>::execute(value) \
)
# endif
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAST_060902_HPP
#endif // include guard

View File

@@ -0,0 +1,46 @@
// 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_IS_TAGGED_ARGUMENT_HPP
#define BOOST_PARAMETER_IS_TAGGED_ARGUMENT_HPP
namespace boost { namespace parameter { namespace aux {
struct tagged_argument_base
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_tagged_argument_aux
: ::boost::is_convertible<
T*
, ::boost::parameter::aux::tagged_argument_base const*
>
{
};
// This metafunction identifies tagged_argument specializations
// and their derived classes.
template <typename T>
struct is_tagged_argument
: ::boost::mpl::if_<
::boost::is_lvalue_reference<T>
, ::boost::mpl::false_
, ::boost::parameter::aux::is_tagged_argument_aux<T>
>::type
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,16 @@
// 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_LAMBDA_TAG_HPP
#define BOOST_PARAMETER_AUX_LAMBDA_TAG_HPP
namespace boost { namespace parameter { namespace aux {
// Tag type passed to MPL lambda.
struct lambda_tag;
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,78 @@
// 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_AUX_NAME_HPP
#define BOOST_PARAMETER_AUX_NAME_HPP
namespace boost { namespace parameter { namespace aux {
struct name_tag_base
{
};
template <typename Tag>
struct name_tag
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_name_tag : ::boost::mpl::false_
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/value_type.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if !defined(BOOST_NO_SFINAE) && \
!BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
#include <boost/parameter/aux_/lambda_tag.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/bind.hpp>
#include <boost/mpl/quote.hpp>
#include <boost/core/enable_if.hpp>
namespace boost { namespace mpl {
template <typename T>
struct lambda<
T
, typename ::boost::enable_if<
::boost::parameter::aux::is_name_tag<T>
, ::boost::parameter::aux::lambda_tag
>::type
>
{
typedef ::boost::mpl::true_ is_le;
typedef ::boost::mpl::bind3<
::boost::mpl::quote3< ::boost::parameter::value_type>
, ::boost::mpl::arg<2>
, T
, void
> result_;
typedef result_ type;
};
}} // namespace boost::mpl
#endif // SFINAE enabled, not Borland.
#include <boost/parameter/aux_/void.hpp>
#define BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag) \
::boost::parameter::value_type< \
::boost::mpl::_2,tag,::boost::parameter::void_ \
>
/**/
#endif // include guard

View File

@@ -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

View File

@@ -0,0 +1,129 @@
// 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
>
struct deduce_tag;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/lambda_tag.hpp>
#include <boost/parameter/aux_/set.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/aux_/pack/tag_deduced.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/assert.hpp>
namespace boost { namespace parameter { namespace aux {
// Helper for deduce_tag<...>, below.
template <
typename Argument
, typename ArgumentPack
, typename DeducedArgs
, typename UsedArgs
, typename TagFn
>
struct deduce_tag0
{
typedef typename DeducedArgs::spec spec;
typedef typename ::boost::mpl::apply_wrap2<
typename ::boost::mpl::lambda<
typename spec::predicate
, ::boost::parameter::aux::lambda_tag
>::type
, Argument
, ArgumentPack
>::type condition;
// 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::if_<
condition
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::true_
>::type
));
typedef typename ::boost::mpl::eval_if<
condition
, ::boost::parameter::aux::tag_deduced<UsedArgs,spec,Argument,TagFn>
, ::boost::parameter::aux::deduce_tag<
Argument
, ArgumentPack
, typename DeducedArgs::tail
, UsedArgs
, TagFn
>
>::type type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
#include <boost/type_traits/is_same.hpp>
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
>
struct deduce_tag
: ::boost::mpl::eval_if<
::boost::is_same<DeducedArgs,::boost::parameter::void_>
, ::boost::mpl::pair< ::boost::parameter::void_,UsedArgs>
, ::boost::parameter::aux::deduce_tag0<
Argument
, ArgumentPack
, DeducedArgs
, UsedArgs
, TagFn
>
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

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

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

View File

@@ -0,0 +1,28 @@
// 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/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
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
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

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(__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(__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

View File

@@ -0,0 +1,276 @@
// 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_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 Positional
, typename UsedArgs
, typename ArgumentPack
, typename Error
>
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/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>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
namespace boost { namespace parameter { namespace aux {
// 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 Positional
, typename UsedArgs
, typename ArgumentPack
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
, typename argument
#endif
, typename Error
>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
struct make_arg_list00
#else
struct make_arg_list0
#endif
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
typedef typename List::arg argument;
#endif
typedef typename ::boost::remove_const<
typename ::boost::remove_reference<argument>::type
>::type arg_type;
typedef typename List::spec parameter_spec;
typedef typename ::boost::parameter::aux
::tag_type<parameter_spec>::type tag_;
typedef ::boost::parameter::aux
::is_named_argument<argument> is_tagged;
// If this argument is either explicitly tagged or a deduced
// parameter, then turn off positional matching.
typedef typename ::boost::mpl::eval_if<
Positional
, ::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 positional;
// 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.
typedef typename ::boost::mpl::eval_if<
is_tagged
, ::boost::parameter::aux::insert_tagged<UsedArgs,arg_type>
, ::boost::mpl::identity<UsedArgs>
>::type used_args;
// If this parameter is neither explicitly tagged nor positionally
// matched, then deduce the tag from the deduced parameter specs.
typedef typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
is_tagged
, ::boost::mpl::true_
, positional
>::type
, ::boost::mpl::pair< ::boost::parameter::void_,used_args>
, ::boost::parameter::aux::deduce_tag<
argument
, ArgumentPack
, DeducedArgs
, used_args
, TagFn
>
>::type deduced_data;
// 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 ...
positional
// ... tag it positionally
, ::boost::mpl::apply_wrap2<TagFn,tag_,argument>
// ... else, use the deduced tag
, ::boost::mpl::first<deduced_data>
>
>::type tagged;
// Build the arg_list incrementally, prepending new nodes.
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
, ::boost::parameter::aux::unmatched_argument<argument>
, ::boost::parameter::void_
>::type error;
typedef typename ::boost::mpl::if_<
::boost::is_same<tagged,::boost::parameter::void_>
, ArgumentPack
, ::boost::parameter::aux::arg_list<tagged,ArgumentPack>
>::type argument_pack;
typedef typename ::boost::parameter::aux::make_arg_list_aux<
typename List::tail
, DeducedArgs
, TagFn
, positional
, typename deduced_data::second
, argument_pack
, error
>::type type;
};
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename Positional
, typename UsedArgs
, typename ArgumentPack
, typename Error
>
struct make_arg_list0
{
typedef typename ::boost::mpl::eval_if<
typename List::is_arg_const
, ::boost::parameter::aux::make_arg_list00<
List
, DeducedArgs
, TagFn
, Positional
, UsedArgs
, ArgumentPack
, typename List::arg const
, Error
>
, ::boost::parameter::aux::make_arg_list00<
List
, DeducedArgs
, TagFn
, Positional
, UsedArgs
, ArgumentPack
, typename List::arg
, Error
>
>::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.
//
// Positional: 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 Positional
, typename DeducedSet
, typename ArgumentPack
, typename Error
>
struct make_arg_list_aux
: ::boost::mpl::eval_if<
::boost::is_same<List,::boost::parameter::void_>
, ::boost::mpl::identity< ::boost::mpl::pair<ArgumentPack,Error> >
, ::boost::parameter::aux::make_arg_list0<
List
, DeducedArgs
, TagFn
, Positional
, DeducedSet
, ArgumentPack
, Error
>
>
{
};
}}} // 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
, typename EmitErrors = ::boost::mpl::true_
>
struct make_arg_list
: ::boost::parameter::aux::make_arg_list_aux<
List
, DeducedArgs
, TagFn
, ::boost::mpl::true_
, ::boost::parameter::aux::set0
, ::boost::parameter::aux::empty_arg_list
, ::boost::parameter::void_
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

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_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/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Spec, typename Tail>
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
>
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

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_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/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace parameter { namespace aux {
// Creates a item typelist.
template <typename Spec, typename Arg, typename Tail>
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>
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

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

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_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/mpl/bool.hpp>
#include <boost/mpl/always.hpp>
namespace boost { namespace parameter { namespace aux {
template <>
struct get_predicate_or_default< ::boost::parameter::aux::use_default>
{
typedef ::boost::mpl::always< ::boost::mpl::true_> type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
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::mpl::always< ::boost::mpl::true_>
>
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,92 @@
// 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/mpl/bool.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
#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
#include <boost/parameter/aux_/yesno.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Returns mpl::true_ iff the given ParameterRequirements are satisfied by
// ArgList.
template <typename ArgList, typename ParameterRequirements>
struct 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;
typedef typename ::boost::mpl::eval_if<
::boost::is_same<bound,::boost::parameter::void_>
, typename ParameterRequirements::has_default
, ::boost::mpl::apply_wrap2<
::boost::parameter::aux::augment_predicate<
typename ParameterRequirements::predicate
, typename ArgList::reference
, typename ArgList::key_type
>
, bound
, ArgList
>
>::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_TTI_DETAIL_NULLPTR
)
, static_cast<ArgList*>(BOOST_TTI_DETAIL_NULLPTR)
)
)
) == sizeof(::boost::parameter::aux::yes_tag)
)
);
typedef ::boost::mpl::bool_<satisfies::value> type;
#endif // MSVC 7.1 workarounds needed.
};
}}} // 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>
struct satisfies_requirements_of
: ::boost::parameter::aux::satisfies<
ArgList
, typename ::boost::parameter::aux
::as_parameter_requirements<ParameterSpec>::type
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,37 @@
// 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/mpl/pair.hpp>
#include <boost/mpl/apply_wrap.hpp>
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
{
typedef ::boost::mpl::pair<
typename ::boost::mpl::apply_wrap2<
TagFn
, typename ::boost::parameter::aux::tag_type<Spec>::type
, Arg
>::type
, typename ::boost::parameter::aux::insert_<
UsedArgs
, typename ::boost::parameter::aux::tag_type<Spec>::type
>::type
> type;
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,24 @@
// 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>
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;
};
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,24 @@
// 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/aux_/template_keyword.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;
};
};
}}} // namespace boost::parameter::aux
#endif // include guard

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_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/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct get_tag_type
: ::boost::mpl::eval_if<
::boost::parameter::aux::is_deduced_aux<typename T::key_type>
, ::boost::parameter::aux::get_tag_type0<typename T::key_type>
, ::boost::mpl::identity<typename T::key_type>
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.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 // include guard

View File

@@ -0,0 +1,31 @@
// 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/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct unmatched_argument
{
BOOST_MPL_ASSERT((
typename ::boost::mpl::if_<
::boost::is_same<T,void>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
));
typedef int type;
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -1,25 +1,12 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// 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 PARAMETER_REQUIREMENTS_050331_HPP
#define PARAMETER_REQUIREMENTS_050331_HPP
namespace boost { namespace parameter { namespace aux {
#include <boost/parameter/aux_/pack/parameter_requirements.hpp>
// 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 <class Keyword, class Predicate, class HasDefault>
struct parameter_requirements
{
typedef Keyword keyword;
typedef Predicate predicate;
typedef HasDefault has_default;
};
#endif // include guard
}}} // namespace boost::parameter::aux
#endif // PARAMETER_REQUIREMENTS_050331_HPP

View File

@@ -1,35 +1,12 @@
// Copyright David Abrahams 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)
// Copyright David Abrahams 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_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
# define BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
#define BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
# include <boost/config.hpp>
# include <boost/detail/workaround.hpp>
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
namespace boost { namespace parameter { namespace aux {
#endif // include guard
// A macro that takes a parenthesized C++ type name (T) and transforms
// it into an un-parenthesized type expression equivalent to T.
# define BOOST_PARAMETER_PARENTHESIZED_TYPE(x) \
boost::parameter::aux::unaryfunptr_arg_type< void(*)x >::type
// A metafunction that transforms void(*)(T) -> T
template <class UnaryFunctionPointer>
struct unaryfunptr_arg_type;
template <class Arg>
struct unaryfunptr_arg_type<void(*)(Arg)>
{
typedef Arg type;
};
template <>
struct unaryfunptr_arg_type<void(*)(void)>
{
typedef void type;
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP

View File

@@ -0,0 +1,47 @@
// 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_AUX_PP_IMPL_ARGUMENT_PACK_HPP
#define BOOST_PARAMETER_AUX_PP_IMPL_ARGUMENT_PACK_HPP
#include <boost/parameter/aux_/pack/tag_keyword_arg.hpp>
#include <boost/parameter/aux_/pack/make_arg_list.hpp>
#include <boost/parameter/aux_/pack/make_items.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_begin.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
namespace boost { namespace parameter { namespace aux {
template <
typename Parameters
, BOOST_PP_ENUM_BINARY_PARAMS(
BOOST_PARAMETER_MAX_ARITY
, typename A
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT
)
>
struct argument_pack
{
typedef typename ::boost::parameter::aux::make_arg_list<
typename BOOST_PARAMETER_build_arg_list(
BOOST_PARAMETER_MAX_ARITY
, ::boost::parameter::aux::make_items
, typename Parameters::parameter_spec
, A
)::type
, typename Parameters::deduced_list
, ::boost::parameter::aux::tag_keyword_arg
, ::boost::mpl::false_
>::type result;
typedef typename ::boost::mpl::first<result>::type type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_end.hpp>
#endif // include guard

View File

@@ -0,0 +1,36 @@
// 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_AUX_PP_IMPL_MATCH_HPP
#define BOOST_PARAMETER_AUX_PP_IMPL_MATCH_HPP
#include <boost/parameter/config.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
namespace boost { namespace parameter { namespace aux {
// Recast the ParameterSpec's nested match metafunction
// as a free metafunction.
template <
typename Parameters
, BOOST_PP_ENUM_BINARY_PARAMS(
BOOST_PARAMETER_MAX_ARITY
, typename A
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT
)
>
struct match
: Parameters::BOOST_NESTED_TEMPLATE match<
BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, A)
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,75 @@
// 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_AUX_PP_IMPL_UNWRAP_PREDICATE_HPP
#define BOOST_PARAMETER_AUX_PP_IMPL_UNWRAP_PREDICATE_HPP
namespace boost { namespace parameter { namespace aux {
// Given Match, which is "void x" where x is an argument matching
// criterion, extract a corresponding MPL predicate.
template <typename Match>
struct unwrap_predicate;
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
#include <boost/mpl/always.hpp>
namespace boost { namespace parameter { namespace aux {
// Match anything
template <>
struct unwrap_predicate<void*>
{
typedef ::boost::mpl::always< ::boost::mpl::true_> type;
};
}}} // namespace boost::parameter::aux
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
#include <boost/parameter/aux_/void.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// A matching predicate is explicitly specified.
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
template <typename Predicate>
struct unwrap_predicate< ::boost::parameter::aux::voidstar(Predicate)>
{
typedef Predicate type;
};
#else
template <typename Predicate>
struct unwrap_predicate<void *(Predicate)>
{
typedef Predicate type;
};
#endif // SunProCC workarounds needed.
}}} // namespace boost::parameter::aux
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_convertible.hpp>
namespace boost { namespace parameter { namespace aux {
// A type to which the argument is supposed to be convertible is
// specified.
template <typename Target>
struct unwrap_predicate<void (Target)>
{
typedef ::boost::mpl::if_<
::boost::is_convertible< ::boost::mpl::_,Target>
, ::boost::mpl::true_
, ::boost::mpl::false_
> type;
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -1,115 +1,12 @@
// Copyright Daniel Wallin 2005. Use, modification and distribution is
// subject to 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)
// Copyright Daniel Wallin 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_FLATTEN_051217_HPP
# define BOOST_PARAMETER_FLATTEN_051217_HPP
#define BOOST_PARAMETER_FLATTEN_051217_HPP
# include <boost/preprocessor/tuple/elem.hpp>
# include <boost/preprocessor/tuple/rem.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/seq/for_each.hpp>
# include <boost/preprocessor/seq/for_each_i.hpp>
# include <boost/preprocessor/identity.hpp>
# include <boost/preprocessor/selection/max.hpp>
# include <boost/preprocessor/arithmetic/sub.hpp>
# include <boost/preprocessor/repetition/enum_trailing.hpp>
# include <boost/parameter/aux_/preprocessor/for_each.hpp>
#include <boost/parameter/aux_/preprocessor/impl/flatten.hpp>
# define BOOST_PARAMETER_FLATTEN_SPLIT_required required,
# define BOOST_PARAMETER_FLATTEN_SPLIT_optional optional,
# define BOOST_PARAMETER_FLATTEN_SPLIT_deduced deduced,
# define BOOST_PARAMETER_FLATTEN_SPLIT(sub) \
BOOST_PP_CAT(BOOST_PARAMETER_FLATTEN_SPLIT_, sub)
# define BOOST_PARAMETER_FLATTEN_QUALIFIER(sub) \
BOOST_PP_SPLIT(0, BOOST_PARAMETER_FLATTEN_SPLIT(sub))
# define BOOST_PARAMETER_FLATTEN_ARGS(sub) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_FLATTEN_SPLIT(sub))
# define BOOST_PARAMETER_FLATTEN_ARITY_optional(arities) \
BOOST_PP_TUPLE_ELEM(3,0,arities)
# define BOOST_PARAMETER_FLATTEN_ARITY_required(arities) \
BOOST_PP_TUPLE_ELEM(3,1,arities)
# define BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM(z, n, data) ~
# define BOOST_PARAMETER_FLATTEN_SPEC0(r, n, elem, data) \
(( \
BOOST_PP_TUPLE_ELEM(3,2,data) \
, BOOST_PP_TUPLE_REM(BOOST_PP_TUPLE_ELEM(3,0,data)) elem \
BOOST_PP_ENUM_TRAILING( \
BOOST_PP_SUB( \
BOOST_PP_TUPLE_ELEM(3,1,data) \
, BOOST_PP_TUPLE_ELEM(3,0,data) \
) \
, BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM \
, ~ \
) \
))
# define BOOST_PARAMETER_FLATTEN_SPEC_AUX(r, arity, max_arity, spec, transform) \
BOOST_PARAMETER_FOR_EACH_R( \
r \
, arity \
, BOOST_PARAMETER_FLATTEN_ARGS(spec) \
, (arity, max_arity, transform(BOOST_PARAMETER_FLATTEN_QUALIFIER(spec))) \
, BOOST_PARAMETER_FLATTEN_SPEC0 \
)
# define BOOST_PARAMETER_FLATTEN_IDENTITY(x) x
# define BOOST_PARAMETER_FLATTEN_SPEC_optional(r, arities, spec) \
BOOST_PARAMETER_FLATTEN_SPEC_AUX( \
r \
, BOOST_PP_CAT( \
BOOST_PARAMETER_FLATTEN_ARITY_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
)(arities) \
, BOOST_PP_TUPLE_ELEM(3,2,arities) \
, spec \
, BOOST_PARAMETER_FLATTEN_IDENTITY \
)
# define BOOST_PARAMETER_FLATTEN_SPEC_required(r, arities, spec) \
BOOST_PARAMETER_FLATTEN_SPEC_optional(r, arities, spec)
# define BOOST_PARAMETER_FLATTEN_SPEC_AS_DEDUCED(x) BOOST_PP_CAT(deduced_,x)
# define BOOST_PARAMETER_FLATTEN_SPEC_deduced_M(r, arities, n, spec) \
BOOST_PARAMETER_FLATTEN_SPEC_AUX( \
r \
, BOOST_PP_CAT( \
BOOST_PARAMETER_FLATTEN_ARITY_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
)(arities) \
, BOOST_PP_TUPLE_ELEM(3,2,arities) \
, spec \
, BOOST_PARAMETER_FLATTEN_SPEC_AS_DEDUCED \
)
# define BOOST_PARAMETER_FLATTEN_SPEC_deduced(r, arities, spec) \
BOOST_PP_SEQ_FOR_EACH_I_R( \
r \
, BOOST_PARAMETER_FLATTEN_SPEC_deduced_M \
, arities \
, BOOST_PARAMETER_FLATTEN_ARGS(spec) \
)
# define BOOST_PARAMETER_FLATTEN_SPEC(r, arities, spec) \
BOOST_PP_CAT( \
BOOST_PARAMETER_FLATTEN_SPEC_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
)(r, arities, spec)
# define BOOST_PARAMETER_FLATTEN(optional_arity, required_arity, wanted_arity, specs) \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_FLATTEN_SPEC \
, ( \
optional_arity, required_arity \
, wanted_arity \
) \
, specs \
)
#endif // BOOST_PARAMETER_FLATTEN_051217_HPP
#endif // include guard

View File

@@ -0,0 +1,24 @@
// 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_AUX_PREPROCESSOR_IMPL_ARGUMENT_SPECS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARGUMENT_SPECS_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the argument specs tuple.
#define BOOST_PARAMETER_FN_ARG_QUALIFIER(x) BOOST_PP_TUPLE_ELEM(4, 0, x)
#define BOOST_PARAMETER_FN_ARG_KEYWORD(x) BOOST_PP_TUPLE_ELEM(4, 1, x)
#define BOOST_PARAMETER_FN_ARG_PRED(x) BOOST_PP_TUPLE_ELEM(4, 2, x)
#define BOOST_PARAMETER_FN_ARG_DEFAULT(x) BOOST_PP_TUPLE_ELEM(4, 3, x)
#include <boost/parameter/aux_/preprocessor/qualifier.hpp>
#define BOOST_PARAMETER_FN_ARG_NAME(x) \
BOOST_PARAMETER_UNQUALIFIED(BOOST_PARAMETER_FN_ARG_KEYWORD(x))
/**/
#endif // include guard

View File

@@ -0,0 +1,42 @@
// 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_AUX_PREPROCESSOR_IMPL_ARITY_RANGE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARITY_RANGE_HPP
// Helper macros for BOOST_PARAMETER_ARITY_RANGE.
#define BOOST_PARAMETER_ARITY_RANGE_M_optional(state) state
#define BOOST_PARAMETER_ARITY_RANGE_M_deduced_optional(state) state
#include <boost/preprocessor/arithmetic/inc.hpp>
#define BOOST_PARAMETER_ARITY_RANGE_M_required(state) BOOST_PP_INC(state)
#define BOOST_PARAMETER_ARITY_RANGE_M_deduced_required(state) \
BOOST_PP_INC(state)
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_ARITY_RANGE_M(s, state, x) \
BOOST_PP_CAT( \
BOOST_PARAMETER_ARITY_RANGE_M_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(x) \
)(state)
/**/
#include <boost/preprocessor/seq/fold_left.hpp>
#include <boost/preprocessor/seq/size.hpp>
// Calculates [begin, end) arity range.
#define BOOST_PARAMETER_ARITY_RANGE(args) \
( \
BOOST_PP_SEQ_FOLD_LEFT(BOOST_PARAMETER_ARITY_RANGE_M, 0, args) \
, BOOST_PP_INC(BOOST_PP_SEQ_SIZE(args)) \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,116 @@
// Copyright Daniel Wallin 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_PREPROCESSOR_IMPL_FLATTEN_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FLATTEN_HPP
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/identity.hpp>
#include <boost/preprocessor/selection/max.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/repetition/enum_trailing.hpp>
#include <boost/parameter/aux_/preprocessor/for_each.hpp>
#define BOOST_PARAMETER_FLATTEN_SPLIT_required required,
#define BOOST_PARAMETER_FLATTEN_SPLIT_optional optional,
#define BOOST_PARAMETER_FLATTEN_SPLIT_deduced deduced,
#define BOOST_PARAMETER_FLATTEN_SPLIT(sub) \
BOOST_PP_CAT(BOOST_PARAMETER_FLATTEN_SPLIT_, sub)
#define BOOST_PARAMETER_FLATTEN_QUALIFIER(sub) \
BOOST_PP_SPLIT(0, BOOST_PARAMETER_FLATTEN_SPLIT(sub))
#define BOOST_PARAMETER_FLATTEN_ARGS(sub) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_FLATTEN_SPLIT(sub))
#define BOOST_PARAMETER_FLATTEN_ARITY_optional(arities) \
BOOST_PP_TUPLE_ELEM(3, 0, arities)
#define BOOST_PARAMETER_FLATTEN_ARITY_required(arities) \
BOOST_PP_TUPLE_ELEM(3, 1, arities)
#define BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM(z, n, data) ~
#define BOOST_PARAMETER_FLATTEN_SPEC0(r, n, elem, data) \
(( \
BOOST_PP_TUPLE_ELEM(3, 2, data) \
, BOOST_PP_TUPLE_REM(BOOST_PP_TUPLE_ELEM(3, 0, data)) elem \
BOOST_PP_ENUM_TRAILING( \
BOOST_PP_SUB( \
BOOST_PP_TUPLE_ELEM(3, 1, data) \
, BOOST_PP_TUPLE_ELEM(3, 0, data) \
) \
, BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM \
, ~ \
) \
))
#define BOOST_PARAMETER_FLATTEN_SPEC_AUX(r, arity, max_arity, spec, xform) \
BOOST_PARAMETER_FOR_EACH_R( \
r \
, arity \
, BOOST_PARAMETER_FLATTEN_ARGS(spec) \
, (arity, max_arity, xform(BOOST_PARAMETER_FLATTEN_QUALIFIER(spec))) \
, BOOST_PARAMETER_FLATTEN_SPEC0 \
)
#define BOOST_PARAMETER_FLATTEN_IDENTITY(x) x
#define BOOST_PARAMETER_FLATTEN_SPEC_optional(r, arities, spec) \
BOOST_PARAMETER_FLATTEN_SPEC_AUX( \
r \
, BOOST_PP_CAT( \
BOOST_PARAMETER_FLATTEN_ARITY_ \
, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
)(arities) \
, BOOST_PP_TUPLE_ELEM(3, 2, arities) \
, spec \
, BOOST_PARAMETER_FLATTEN_IDENTITY \
)
#define BOOST_PARAMETER_FLATTEN_SPEC_required(r, arities, spec) \
BOOST_PARAMETER_FLATTEN_SPEC_optional(r, arities, spec)
#define BOOST_PARAMETER_FLATTEN_SPEC_AS_DEDUCED(x) BOOST_PP_CAT(deduced_, x)
#define BOOST_PARAMETER_FLATTEN_SPEC_deduced_M(r, arities, n, spec) \
BOOST_PARAMETER_FLATTEN_SPEC_AUX( \
r \
, BOOST_PP_CAT( \
BOOST_PARAMETER_FLATTEN_ARITY_ \
, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
)(arities) \
, BOOST_PP_TUPLE_ELEM(3, 2, arities) \
, spec \
, BOOST_PARAMETER_FLATTEN_SPEC_AS_DEDUCED \
)
#define BOOST_PARAMETER_FLATTEN_SPEC_deduced(r, arities, spec) \
BOOST_PP_SEQ_FOR_EACH_I_R( \
r \
, BOOST_PARAMETER_FLATTEN_SPEC_deduced_M \
, arities \
, BOOST_PARAMETER_FLATTEN_ARGS(spec) \
)
#define BOOST_PARAMETER_FLATTEN_SPEC(r, arities, spec) \
BOOST_PP_CAT( \
BOOST_PARAMETER_FLATTEN_SPEC_ \
, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
)(r, arities, spec)
#define BOOST_PARAMETER_FLATTEN(opt_arity, req_arity, wanted_arity, specs) \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_FLATTEN_SPEC \
, (opt_arity, req_arity, wanted_arity) \
, specs \
)
#endif // include guard

View File

@@ -0,0 +1,283 @@
// 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_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_PRODUCT(r, product) \
(product)
/**/
#include <boost/preprocessor/repetition/enum_params.hpp>
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_TEMPLATE_HEADER_Z(z, n, p) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename p)>
/**/
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_FUNCTION_ARGUMENT(r, _, i, elem) \
BOOST_PP_COMMA_IF(i) elem& BOOST_PP_CAT(a, i)
/**/
#include <boost/parameter/aux_/preprocessor/qualifier.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/config.hpp>
#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
// No partial ordering. This feature doesn't work.
#define BOOST_PARAMETER_FUNCTION_FORWARD_COMBINATION(r, _, i, elem) \
(BOOST_PP_IF( \
BOOST_PARAMETER_IS_QUALIFIER( \
BOOST_PARAMETER_FN_ARG_KEYWORD(elem) \
) \
, (BOOST_PP_CAT(ParameterArgumentType, i)) \
, (BOOST_PP_CAT(ParameterArgumentType, i) const) \
))
/**/
#else
#define BOOST_PARAMETER_FUNCTION_FORWARD_COMBINATION(r, _, i, elem) \
(BOOST_PP_IF( \
BOOST_PARAMETER_IS_QUALIFIER( \
BOOST_PARAMETER_FN_ARG_KEYWORD(elem) \
) \
, (BOOST_PP_CAT(ParameterArgumentType, i) const) \
(BOOST_PP_CAT(ParameterArgumentType, i)) \
, (BOOST_PP_CAT(ParameterArgumentType, i) const) \
))
/**/
#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
#include <boost/preprocessor/seq/for_each_i.hpp>
#define BOOST_PARAMETER_FUNCTION_FORWARD_COMBINATIONS(args) \
BOOST_PP_SEQ_FOR_EACH_I( \
BOOST_PARAMETER_FUNCTION_FORWARD_COMBINATION, ~, args \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL(z, n, r, data, elem) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_TEMPLATE_HEADER_Z \
, BOOST_PP_TUPLE_EAT(3) \
)(z, n, ParameterArgumentType) \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) \
BOOST_PP_TUPLE_ELEM(5, 2, data)( \
BOOST_PP_IF( \
n, BOOST_PP_SEQ_FOR_EACH_I_R, BOOST_PP_TUPLE_EAT(4) \
)(r, BOOST_PARAMETER_FUNCTION_ARGUMENT, ~, elem) \
BOOST_PP_IF( \
n, BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z, BOOST_PP_TUPLE_EAT(4) \
)( \
z \
, BOOST_PP_CAT(constructor_parameters, __LINE__) \
, n \
, ParameterArgumentType \
) \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE( \
BOOST_PP_TUPLE_ELEM(5, 3, data) \
)( \
BOOST_PP_CAT(constructor_parameters, __LINE__)()( \
BOOST_PP_ENUM_PARAMS_Z(z, n, a) \
) \
) \
{ \
}
/**/
#include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL(z, n, r, data, elem) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_TEMPLATE_HEADER_Z \
, BOOST_PP_TUPLE_EAT(3) \
)(z, n, ParameterArgumentType) \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(6, 3, data)) \
inline BOOST_PP_EXPR_IF(n, typename) \
BOOST_PARAMETER_FUNCTION_RESULT_NAME(BOOST_PP_TUPLE_ELEM(6, 3, data))< \
BOOST_PP_EXPR_IF(n, typename) \
::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(6, 3, data) \
) \
BOOST_PP_COMMA_IF(n) \
BOOST_PP_IF( \
n, BOOST_PP_SEQ_ENUM, BOOST_PP_TUPLE_EAT(1) \
)(elem) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(6, 2, data))( \
BOOST_PP_IF( \
n, BOOST_PP_SEQ_FOR_EACH_I_R, BOOST_PP_TUPLE_EAT(4) \
)(r, BOOST_PARAMETER_FUNCTION_ARGUMENT, ~, elem) \
BOOST_PP_IF( \
n, BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z, BOOST_PP_TUPLE_EAT(4) \
)( \
z \
, BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(6, 3, data) \
) \
, n \
, ParameterArgumentType \
) \
) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(6, 5, data), const) \
{ \
return BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(6, 3, data) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(6, 3, data) \
)()(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
); \
}
/**/
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL_R(r, data, elem) \
BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL( \
BOOST_PP_TUPLE_ELEM(5, 0, data) \
, BOOST_PP_TUPLE_ELEM(5, 1, data) \
, r \
, data \
, elem \
)
/**/
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL_R(r, data, elem) \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL( \
BOOST_PP_TUPLE_ELEM(6, 0, data) \
, BOOST_PP_TUPLE_ELEM(6, 1, data) \
, r \
, data \
, elem \
)
/**/
#include <boost/preprocessor/repetition/deduce_r.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL_ARITY_0(z, n, data) \
BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL( \
z \
, n \
, BOOST_PP_DEDUCE_R() \
, (z, n, BOOST_PP_TUPLE_REM(3) data) \
, ~ \
)
/**/
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL_ARITY_0(z, n, data) \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL( \
z \
, n \
, BOOST_PP_DEDUCE_R() \
, (z, n, BOOST_PP_TUPLE_REM(4) data) \
, ~ \
)
/**/
#include <boost/preprocessor/seq/first_n.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_product.hpp>
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL_ARITY_N(z, n, data) \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL_R \
, (z, n, BOOST_PP_TUPLE_REM(3) data) \
, BOOST_PP_SEQ_FOR_EACH_PRODUCT( \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_PRODUCT \
, BOOST_PP_SEQ_FIRST_N(n, BOOST_PP_TUPLE_ELEM(3, 2, data)) \
) \
)
/**/
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL_ARITY_N(z, n, data) \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL_R \
, (z, n, BOOST_PP_TUPLE_REM(4) data) \
, BOOST_PP_SEQ_FOR_EACH_PRODUCT( \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_PRODUCT \
, BOOST_PP_SEQ_FIRST_N(n, BOOST_PP_TUPLE_ELEM(4, 2, data)) \
) \
)
/**/
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL_ARITY_N \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_IMPL_ARITY_0 \
)(z, n, data)
/**/
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL_ARITY_N \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_IMPL_ARITY_0 \
)(z, n, data)
/**/
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
// Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, r, combo) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, r) \
, BOOST_PP_TUPLE_ELEM(2, 1, r) \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z \
, (class_, base, combo) \
)
/**/
// Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(n, i, r, combo, c) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, r) \
, BOOST_PP_TUPLE_ELEM(2, 1, r) \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z \
, (n, i, combo, c) \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
// Expands to the layer of forwarding functions for the constructor in the
// specified class, whose arguments determine the range of arities.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args) \
BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX( \
class_ \
, base \
, BOOST_PARAMETER_ARITY_RANGE(args) \
, BOOST_PARAMETER_FUNCTION_FORWARD_COMBINATIONS(args) \
)
/**/
// Expands to the layer of forwarding functions for the function with the
// specified name, whose arguments determine the range of arities.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, args, const_) \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX( \
name \
, impl \
, BOOST_PARAMETER_ARITY_RANGE(args) \
, BOOST_PARAMETER_FUNCTION_FORWARD_COMBINATIONS(args) \
, const_ \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,154 @@
// 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_AUX_PREPROCESSOR_IMPL_FUNCTION_CAST_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_CAST_HPP
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
#define BOOST_PARAMETER_FUNCTION_CAST(value, predicate) value
#else // !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
namespace boost { namespace parameter { namespace aux {
// Handles possible implicit casts. Used by preprocessor.hpp
// to normalize user input.
//
// cast<void*>::execute() is identity
// cast<void*(X)>::execute() is identity
// cast<void(X)>::execute() casts to X
//
// preprocessor.hpp uses this like this:
//
// #define X(value, predicate)
// cast<void predicate>::execute(value)
//
// X(something, *)
// X(something, *(predicate))
// X(something, (int))
template <typename VoidExpr, typename Args>
struct cast;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/use_default_tag.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Args>
struct cast<void*, Args>
{
static ::boost::parameter::aux::use_default_tag
execute(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
static ::boost::parameter::aux::use_default_tag
remove_const(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
template <typename U>
static U& execute(U& value)
{
return value;
}
template <typename U>
static U& remove_const(U& x)
{
return x;
}
};
}}} // namespace boost::parameter::aux
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
#include <boost/parameter/aux_/void.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Args>
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
struct cast< ::boost::parameter::aux::voidstar(Predicate),Args>
#else
struct cast<void*(Predicate),Args>
#endif
: ::boost::parameter::aux::cast<void*,Args>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/placeholders.hpp>
namespace boost { namespace parameter { namespace aux {
// This is a hack used in cast<> to turn the user supplied type,
// which may or may not be a placeholder expression, into one,
// so that it will be properly evaluated by mpl::apply.
template <typename T, typename Dummy = ::boost::mpl::_1>
struct as_placeholder_expr
{
typedef T type;
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/apply.hpp>
#include <boost/type_traits/add_lvalue_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T, typename Args>
struct cast<void(T), Args>
{
typedef typename ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<T>
, Args
, Args
>::type type0;
typedef typename ::boost::add_lvalue_reference<
typename ::boost::remove_const<type0>::type
>::type reference;
static ::boost::parameter::aux::use_default_tag
execute(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
static ::boost::parameter::aux::use_default_tag
remove_const(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
static type0 execute(type0 value)
{
return value;
}
template <typename U>
static reference remove_const(U const& x)
{
return const_cast<reference>(x);
}
};
}}} // namespace boost::parameter::aux
#define BOOST_PARAMETER_FUNCTION_CAST(value, predicate, args) \
::boost::parameter::aux::cast<void predicate, args>::remove_const( \
::boost::parameter::aux::cast<void predicate, args>::execute(value) \
)
#endif // Borland workarounds needed.
#endif // include guard

View File

@@ -0,0 +1,350 @@
// 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_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_LAYER_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_LAYER_HPP
#include <boost/preprocessor/cat.hpp>
// Expands to keyword_tag_type for some keyword_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(keyword) \
BOOST_PP_CAT(keyword, _type)
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
// Helpers used as parameters to BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG(r, _, arg) \
, typename BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE( \
BOOST_PARAMETER_FN_ARG_NAME(arg) \
)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN(r, _, arg) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE( \
BOOST_PARAMETER_FN_ARG_NAME(arg) \
)& BOOST_PARAMETER_FN_ARG_NAME(arg)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_PARAMETER(r, _, arg) \
, BOOST_PARAMETER_FN_ARG_NAME(arg)
/**/
#include <boost/parameter/aux_/preprocessor/impl/split_args.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/seq/first_n.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
// Helper macro used below to produce lists based on the keyword argument
// names. macro is applied to every element. n is the number of
// optional arguments that should be included.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS(macro, n, split_args) \
BOOST_PP_SEQ_FOR_EACH( \
macro \
, ~ \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(split_args) \
) \
BOOST_PP_SEQ_FOR_EACH( \
macro \
, ~ \
, BOOST_PP_SEQ_FIRST_N( \
BOOST_PP_SUB( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(split_args) \
, n \
) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(split_args) \
) \
)
/**/
namespace boost { namespace parameter { namespace aux {
template <typename T>
T& as_lvalue(T& value, long)
{
return value;
}
template <typename T>
T const& as_lvalue(T const& value, int)
{
return value;
}
}}} // namespace boost::parameter::aux
#define BOOST_PARAMETER_FUNCTION_DISPATCH_EVAL_ACTUAL_DEFAULT(arg) \
BOOST_PARAMETER_FUNCTION_CAST( \
::boost::parameter::aux::as_lvalue( \
BOOST_PARAMETER_FN_ARG_DEFAULT(arg) \
, 0L \
) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
)
/**/
#include <boost/parameter/keyword.hpp>
#include <boost/parameter/aux_/use_default_tag.hpp>
// Generates a keyword | default expression.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_KW_OR_DEFAULT(arg, tag_namespace) \
::boost::parameter::keyword< \
tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance | ::boost::parameter::aux::use_default_tag()
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_cast.hpp>
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_OR_DEFAULT(arg, tag_ns) \
BOOST_PARAMETER_FUNCTION_CAST( \
args[BOOST_PARAMETER_FUNCTION_DISPATCH_KW_OR_DEFAULT(arg, tag_ns)] \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R(r, tag_namespace, arg) \
, BOOST_PARAMETER_FUNCTION_CAST( \
args[ \
::boost::parameter::keyword< \
tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance \
] \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_dispatch_tuple.hpp>
#include <boost/tti/detail/dnullptr.hpp>
#include <boost/preprocessor/seq/elem.hpp>
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_BODY(x, n) \
{ \
return BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast<ResultType(*)()>(BOOST_TTI_DETAIL_NULLPTR) \
, args \
, 0L \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS( \
BOOST_PARAMETER_FUNCTION_DISPATCH_PARAMETER \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_OR_DEFAULT( \
BOOST_PP_SEQ_ELEM( \
BOOST_PP_SUB( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, n \
) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
) \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_DEFAULT_BODY(x, n) \
template < \
typename ResultType \
, typename Args \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS( \
BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG \
, BOOST_PP_INC(n) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) \
ResultType BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
ResultType(*)() \
, Args const& args \
, long \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN \
, BOOST_PP_INC(n) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, ::boost::parameter::aux::use_default_tag \
) BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const) \
{ \
return BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast<ResultType(*)()>(BOOST_TTI_DETAIL_NULLPTR) \
, args \
, 0L \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS( \
BOOST_PARAMETER_FUNCTION_DISPATCH_PARAMETER \
, BOOST_PP_INC(n) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_EVAL_ACTUAL_DEFAULT( \
BOOST_PP_SEQ_ELEM( \
BOOST_PP_SUB( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PP_INC(n) \
) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
) \
); \
}
/**/
#include <boost/preprocessor/tuple/eat.hpp>
// Defines the actual function body for
// BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_BODY_Z(z, n, x) \
template < \
typename ResultType \
, typename Args \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS( \
BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) \
ResultType BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
ResultType(*)() \
, Args const& args \
, int \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_BODY \
, ; BOOST_PP_TUPLE_EAT(2) \
)(x, n)
/**/
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/logical/or.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
BOOST_PP_OR(n, BOOST_PP_TUPLE_ELEM(2, 0, data)) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_BODY_Z \
, BOOST_PP_TUPLE_EAT(3) \
)(z, n, BOOST_PP_TUPLE_ELEM(2, 1, data)) \
BOOST_PP_IF( \
BOOST_PP_EQUAL( \
n \
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS( \
BOOST_PP_TUPLE_ELEM(2, 1, data) \
) \
) \
) \
, BOOST_PP_TUPLE_EAT(2) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_DEFAULT_BODY \
)(BOOST_PP_TUPLE_ELEM(2, 1, data), n)
/**/
// Generates the function template that receives an ArgumentPack, and then
// goes on to call the layers of overloads generated by
// BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER.
#define BOOST_PARAMETER_FUNCTION_INITIAL_DISPATCH_FUNCTION(x) \
template <typename Args> \
typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
)<Args>::type BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
)(Args const& args) \
BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const) \
{ \
return BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast< \
typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
)<Args>::type(*)() \
>(BOOST_TTI_DETAIL_NULLPTR) \
, args \
, 0L \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R \
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
); \
}
/**/
// x is a tuple:
//
// (base_name, split_args, is_const, tag_namespace)
//
// Generates all dispatch functions for the function named base_name. Each
// dispatch function that takes in n optional parameters passes the default
// value of the (n + 1)th optional parameter to the next dispatch function.
// The last dispatch function is the back-end implementation, so only the
// header is generated: the user is expected to supply the body.
//
// Also generates the front-end implementation function, which uses
// BOOST_PARAMETER_FUNCTION_CAST to extract each argument from the argument
// pack.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER(fwd_decl, x) \
BOOST_PP_REPEAT_FROM_TO( \
0 \
, BOOST_PP_INC( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z \
, (fwd_decl, x) \
) \
BOOST_PARAMETER_FUNCTION_INITIAL_DISPATCH_FUNCTION(x) \
template < \
typename ResultType \
, typename Args \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS( \
BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG \
, 0 \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) \
ResultType BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
ResultType(*)() \
, Args const& \
, int \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARGUMENTS( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN \
, 0 \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const)
/**/
#endif // include guard

View File

@@ -0,0 +1,29 @@
// 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_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_TUPLE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_TUPLE_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the input tuple to the dispatch macros.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
BOOST_PP_TUPLE_ELEM(4, 0, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
BOOST_PP_TUPLE_ELEM(4, 1, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
BOOST_PP_TUPLE_ELEM(4, 2, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
BOOST_PP_TUPLE_ELEM(4, 3, x)
/**/
#endif // include guard

View File

@@ -0,0 +1,33 @@
// 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_AUX_PREPROCESSOR_IMPL_FUNCTION_FORWARD_MATCH_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_FORWARD_MATCH_HPP
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if !defined(BOOST_NO_SFINAE) && \
!BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
#include <boost/parameter/aux_/pp_impl/match.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
// Expands to an extra argument that is well-formed
// iff all Args... satisfy the requirements set by params.
#define BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z(z, parameters, n, prefix) \
, typename ::boost::parameter::aux::match< \
parameters, BOOST_PP_ENUM_PARAMS(n, prefix) \
>::type = parameters()
/**/
#else
#define BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z(z, parameters, n, prefix)
/**/
#endif
#endif // include guard

View File

@@ -0,0 +1,115 @@
// 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_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
#define BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_static ()
/**/
#include <boost/parameter/aux_/preprocessor/is_nullary.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
BOOST_PARAMETER_IS_NULLARY( \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_, name) \
)
/**/
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
// Workaround for MSVC preprocessor.
//
// When stripping static from "static f", msvc will produce " f". The leading
// whitespace doesn't go away when pasting the token with something else, so
// this thing is a hack to strip the whitespace.
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static (
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name))
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
BOOST_PP_SEQ_HEAD( \
BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
)
/**/
#else
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name)
/**/
#endif // MSVC workarounds needed
#include <boost/preprocessor/control/expr_if.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name), static \
)
/**/
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
BOOST_PP_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
, BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC \
, name BOOST_PP_TUPLE_EAT(1) \
)(name)
/**/
// Produces a name for a parameter specification for the function named base.
#define BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(base) \
BOOST_PP_CAT( \
BOOST_PP_CAT(boost_param_parameters_, __LINE__) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
)
/**/
// Produces a name for a result type metafunction for the function named base.
#define BOOST_PARAMETER_FUNCTION_RESULT_NAME(base) \
BOOST_PP_CAT( \
BOOST_PP_CAT(boost_param_result_, __LINE__) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
)
/**/
// Can't do boost_param_impl_ ## basee
// because base might start with an underscore.
// daniel: what? how is that relevant? the reason for using CAT()
// is to make sure base is expanded. i'm not sure we need to here,
// but it's more stable to do it.
#define BOOST_PARAMETER_FUNCTION_IMPL_NAME(base) \
BOOST_PP_CAT(boost_param_impl, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base))
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_dispatch_tuple.hpp>
// Produces a name for the dispatch functions.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, n) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_CAT(boost_param_dispatch_, n) \
, BOOST_PP_CAT(boost_, __LINE__) \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,34 @@
// Copyright David Abrahams 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_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_TYPE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_TYPE_HPP
namespace boost { namespace parameter { namespace aux {
// A metafunction that transforms void(*)(T) -> T
template <typename UnaryFunctionPointer>
struct unaryfunptr_arg_type;
template <typename Arg>
struct unaryfunptr_arg_type<void(*)(Arg)>
{
typedef Arg type;
};
template <>
struct unaryfunptr_arg_type<void(*)(void)>
{
typedef void type;
};
}}} // namespace boost::parameter::aux
// A macro that takes a parenthesized C++ type name (T) and transforms it
// into an un-parenthesized type expression equivalent to T.
#define BOOST_PARAMETER_PARENTHESIZED_TYPE(x) \
::boost::parameter::aux::unaryfunptr_arg_type< void(*)x >::type
#endif // include guard

View File

@@ -0,0 +1,95 @@
// 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_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP
#include <boost/parameter/optional.hpp>
// Helper macros for BOOST_PARAMETER_SPECIFICATION_ELEM_R.
#define BOOST_PARAMETER_QUALIFIED_TAG_optional(tag) \
optional<tag
/**/
#include <boost/parameter/required.hpp>
#define BOOST_PARAMETER_QUALIFIED_TAG_required(tag) \
required<tag
/**/
#include <boost/parameter/deduced.hpp>
#define BOOST_PARAMETER_QUALIFIED_TAG_deduced_optional(tag) \
optional< ::boost::parameter::deduced<tag>
/**/
#define BOOST_PARAMETER_QUALIFIED_TAG_deduced_required(tag) \
required< ::boost::parameter::deduced<tag>
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
#include <boost/parameter/aux_/use_default.hpp>
#define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \
BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \
BOOST_PARAMETER_QUALIFIED_TAG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
)(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \
, ::boost::parameter::aux::use_default \
>
/**/
#else // !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
#include <boost/parameter/aux_/pp_impl/unwrap_predicate.hpp>
// Expands to each boost::parameter::parameters<> element type.
#define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \
BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \
BOOST_PARAMETER_QUALIFIED_TAG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
)(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \
, typename ::boost::parameter::aux::unwrap_predicate< \
void BOOST_PARAMETER_FN_ARG_PRED(elem) \
>::type \
>
/**/
#endif // Borland workarounds needed.
#include <boost/parameter/parameters.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
// Expands to a boost::parameter::parameters<> specialization for the
// function named base. Used by BOOST_PARAMETER_CONSTRUCTOR_AUX and
// BOOST_PARAMETER_FUNCTION_HEAD for their respective ParameterSpec models.
#define BOOST_PARAMETER_SPECIFICATION(tag_ns, base, split_args) \
template <typename BoostParameterDummy> \
struct BOOST_PP_CAT( \
BOOST_PP_CAT(boost_param_params_, __LINE__) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
) : ::boost::parameter::parameters< \
BOOST_PP_SEQ_FOR_EACH_I( \
BOOST_PARAMETER_SPECIFICATION_ELEM_R, tag_ns, split_args \
) \
> \
{ \
}; \
typedef BOOST_PP_CAT( \
BOOST_PP_CAT(boost_param_params_, __LINE__) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)<int>
/**/
#endif // include guard

View File

@@ -0,0 +1,71 @@
// 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_AUX_PREPROCESSOR_IMPL_SPLIT_ARGS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPLIT_ARGS_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the split_args tuple.
#define BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(x) BOOST_PP_TUPLE_ELEM(4, 0, x)
#define BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(x) BOOST_PP_TUPLE_ELEM(4, 1, x)
#define BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(x) BOOST_PP_TUPLE_ELEM(4, 2, x)
#define BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(x) BOOST_PP_TUPLE_ELEM(4, 3, x)
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/seq/push_back.hpp>
// Helper macros for BOOST_PARAMETER_FUNCTION_SPLIT_ARGS.
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(s_a, arg) \
( \
BOOST_PP_INC(BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(s_a)) \
, BOOST_PP_SEQ_PUSH_BACK(BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(s_a), arg) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(s_a) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_a) \
)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_required(split_args, arg) \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(split_args, arg)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(s_a, arg) \
( \
BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(s_a) \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(s_a) \
, BOOST_PP_INC(BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(s_a)) \
, BOOST_PP_SEQ_PUSH_BACK(BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_a), arg) \
)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_optional(split_args, arg) \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(split_args, arg)
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG(s, split_args, arg) \
BOOST_PP_CAT( \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(arg) \
)(split_args, arg)
/**/
#include <boost/preprocessor/seq/fold_left.hpp>
#include <boost/preprocessor/seq/seq.hpp>
// Expands from the flattened BOOST_PARAMETER_FUNCTION et. al. arg sequence to
// the tuple (required_count, required_args, optional_count, optional_args).
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args) \
BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG \
, (0, BOOST_PP_SEQ_NIL, 0, BOOST_PP_SEQ_NIL) \
, args \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,30 @@
// 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_AUX_PREPROCESSOR_IS_BINARY_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IS_BINARY_HPP
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
// From Paul Mensonides
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/preprocessor/detail/split.hpp>
#define BOOST_PARAMETER_IS_BINARY(x) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_BINARY_C x BOOST_PP_COMMA() 0)
/**/
#include <boost/preprocessor/punctuation/paren.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_IS_BINARY_C(x,y) \
~, 1 BOOST_PP_RPAREN() \
BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~
/**/
#else
#include <boost/preprocessor/detail/is_binary.hpp>
#define BOOST_PARAMETER_IS_BINARY(x) BOOST_PP_IS_BINARY(x)
#endif
#endif // include guard

View File

@@ -0,0 +1,31 @@
// 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_AUX_PREPROCESSOR_IS_NULLARY_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IS_NULLARY_HPP
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
// From Paul Mensonides
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/preprocessor/detail/split.hpp>
#define BOOST_PARAMETER_IS_NULLARY(x) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_NULLARY_C x BOOST_PP_COMMA() 0)
/**/
#include <boost/preprocessor/punctuation/paren.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_IS_NULLARY_C() \
~, 1 BOOST_PP_RPAREN() \
BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~
/**/
#else
#include <boost/preprocessor/detail/is_nullary.hpp>
#define BOOST_PARAMETER_IS_NULLARY(x) BOOST_PP_IS_NULLARY(x)
/**/
#endif
#endif // include guard

View File

@@ -0,0 +1,80 @@
// 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)
// No include guard. This file is intended for multiple inclusion.
#define BOOST_PARAMETER_right_angle(z, n, _) >
/**/
#define BOOST_PARAMETER_satisfies_end(z, n, false_t) ,false_t>
/**/
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/cat.hpp>
// Generates:
//
// make<
// parameter_spec##0, argument_type##0
// , make<
// parameter_spec##1, argument_type##1
// , ... boost::mpl::identity<boost::parameter::aux::empty_arg_list>
// ...>
// >
#define BOOST_PARAMETER_make_arg_list(z, n, names) \
BOOST_PP_SEQ_ELEM(0, names)< \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n), \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(2, names), n),
/**/
#include <boost/parameter/aux_/void.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#define BOOST_PARAMETER_build_arg_list(n, make, param_spec, arg_type) \
BOOST_PP_REPEAT( \
n, BOOST_PARAMETER_make_arg_list, (make)(param_spec)(arg_type) \
) \
::boost::mpl::identity< ::boost::parameter::void_> \
BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
/**/
#define BOOST_PARAMETER_make_deduced_list(z, n, names) \
BOOST_PP_SEQ_ELEM(0, names)<BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n),
/**/
#define BOOST_PARAMETER_build_deduced_list(n, make, parameter_spec) \
BOOST_PP_REPEAT( \
n, BOOST_PARAMETER_make_deduced_list, (make)(parameter_spec) \
) \
::boost::mpl::identity< ::boost::parameter::void_> \
BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
/**/
#define BOOST_PARAMETER_forward_typedef(z, n, names) \
typedef BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, names), n) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n);
/**/
#define BOOST_PARAMETER_forward_typedefs(n, src, dest) \
BOOST_PP_REPEAT(n, BOOST_PARAMETER_forward_typedef, (src)(dest))
/**/
#define BOOST_PARAMETER_template_args(z, n, prefix) \
typename BOOST_PP_CAT(prefix, n) = ::boost::parameter::void_
/**/
#include <boost/parameter/aux_/pack/satisfies.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/eval_if.hpp>
#define BOOST_PARAMETER_satisfies_begin(z, n, prefix) \
::boost::mpl::eval_if< \
::boost::parameter::aux::satisfies_requirements_of< \
typename ::boost::mpl::first<ArgumentPackAndError>::type \
, BOOST_PP_CAT(prefix, n) \
>,
/**/

View File

@@ -0,0 +1,18 @@
// 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)
// No include guard. This file is intended for multiple inclusion.
#undef BOOST_PARAMETER_satisfies_begin
#undef BOOST_PARAMETER_template_args
#undef BOOST_PARAMETER_forward_typedefs
#undef BOOST_PARAMETER_forward_typedef
#undef BOOST_PARAMETER_build_deduced_list
#undef BOOST_PARAMETER_make_deduced_list
#undef BOOST_PARAMETER_build_arg_list
#undef BOOST_PARAMETER_make_arg_list
#undef BOOST_PARAMETER_satisfies_end
#undef BOOST_PARAMETER_right_angle

View File

@@ -1,29 +1,33 @@
// Copyright David Abrahams, Daniel Wallin 2003. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// 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)
// This file generates overloads in this format:
//
// template<class A0, class A1>
// typename mpl::apply_wrap1<
// aux::make_arg_list<
// template <typename A0, typename A1>
// typename boost::mpl::apply_wrap1<
// boost::parameter::aux::make_arg_list<
// PS0,A0
// , aux::make_arg_list<
// , boost::parameter::aux::make_arg_list<
// PS1,A1
// , mpl::identity<aux::empty_arg_list>
// , boost::mpl::identity<
// boost::parameter::aux::empty_arg_list
// >
// >
// >
// , unnamed_list
// >::type
// operator()(A0 const& a0, A1 const& a1) const
// {
// typedef typename mpl::apply_wrap1<
// aux::make_arg_list<
// typedef typename boost::mpl::apply_wrap1<
// boost::parameter::aux::make_arg_list<
// PS0,A0
// , aux::make_arg_list<
// , boost::parameter::aux::make_arg_list<
// PS1,A1
// , mpl::identity<aux::empty_arg_list>
// , boost::mpl::identity<
// boost::parameter::aux::empty_arg_list
// >
// >
// >
// >::type arg_tuple;
@@ -31,7 +35,7 @@
// return arg_tuple(
// a0
// , a1
// , aux::void_()
// , boost::parameter::aux::void_()
// ...
// );
// }
@@ -44,45 +48,45 @@
#define N BOOST_PP_ITERATION()
#define BOOST_PARAMETER_open_list(z, n, text) \
aux::item< \
::boost::parameter::aux::item< \
BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
#define BOOST_PARAMETER_close_list(z, n, text) >
#define BOOST_PARAMETER_arg_list(n) \
aux::make_arg_list< \
::boost::parameter::aux::make_arg_list< \
BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
, void_ \
, ::boost::parameter::void_ \
BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
, deduced_list \
, aux::tag_keyword_arg \
, ::boost::parameter::aux::tag_keyword_arg \
>
#define BOOST_PARAMETER_arg_pack_init(z, n, limit) \
BOOST_PP_CAT(a, BOOST_PP_SUB(limit,n))
BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n))
template<BOOST_PP_ENUM_PARAMS(N, class A)>
typename mpl::first<
template <BOOST_PP_ENUM_PARAMS(N, typename A)>
typename ::boost::mpl::first<
typename BOOST_PARAMETER_arg_list(N)::type
>::type
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)) const
{
typedef typename BOOST_PARAMETER_arg_list(N)::type result;
typedef typename mpl::first<result>::type result_type;
typedef typename mpl::second<result>::type error;
typedef typename ::boost::mpl::first<result>::type result_type;
typedef typename ::boost::mpl::second<result>::type error;
error();
return result_type(
BOOST_PP_ENUM(N, BOOST_PARAMETER_arg_pack_init, BOOST_PP_DEC(N))
BOOST_PP_ENUM_TRAILING_PARAMS(
BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, N)
, aux::void_reference() BOOST_PP_INTERCEPT
));
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT
)
);
}
#undef BOOST_PARAMETER_arg_list
#undef BOOST_PARAMETER_open_list
#undef BOOST_PARAMETER_close_list
#undef BOOST_PARAMETER_open_list
#undef N

View File

@@ -0,0 +1,46 @@
// 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_AUX_PREPROCESSOR_QUALIFIER_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_QUALIFIER_HPP
#define BOOST_PARAMETER_QUALIFIER_EAT_out(x)
#define BOOST_PARAMETER_QUALIFIER_EAT_in_out(x)
#define BOOST_PARAMETER_STRIP_QUALIFIER_out(x) x
#define BOOST_PARAMETER_STRIP_QUALIFIER_in_out(x) x
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_GET_UNQUALIFIED(x) \
BOOST_PP_CAT(BOOST_PARAMETER_STRIP_QUALIFIER_, x)
/**/
#include <boost/preprocessor/facilities/is_empty.hpp>
// Expands to 1 if x is either "out(k)" or "in_out(k)";
// expands to 0 otherwise.
#define BOOST_PARAMETER_IS_QUALIFIER(x) \
BOOST_PP_IS_EMPTY(BOOST_PP_CAT(BOOST_PARAMETER_QUALIFIER_EAT_, x))
/**/
#include <boost/preprocessor/control/iif.hpp>
// Expands to the unqualified version of x,
// where x is either a keyword qualifier or a keyword.
//
// k => k
// out(k) => k
// in_out(k) => k
#define BOOST_PARAMETER_UNQUALIFIED(x) \
BOOST_PP_IIF( \
BOOST_PARAMETER_IS_QUALIFIER(x) \
, BOOST_PARAMETER_GET_UNQUALIFIED(x) \
, x \
)
/**/
#endif // include guard

View File

@@ -6,16 +6,17 @@
#ifndef BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
# define BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
# include <boost/parameter/aux_/tagged_argument_fwd.hpp>
# include <boost/parameter/aux_/is_tagged_argument.hpp>
# include <boost/parameter/aux_/default.hpp>
# include <boost/parameter/aux_/void.hpp>
# include <boost/parameter/aux_/arg_list.hpp>
# include <boost/parameter/aux_/result_of0.hpp>
# include <boost/mpl/if.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/identity.hpp>
# include <boost/mpl/apply_wrap.hpp>
# include <boost/mpl/and.hpp>
# include <boost/mpl/not.hpp>
# include <boost/type_traits/is_same.hpp>
# include <boost/type_traits/is_convertible.hpp>
# include <boost/type_traits/is_lvalue_reference.hpp>
# include <boost/type_traits/remove_const.hpp>
# include <boost/config.hpp>
# include <boost/config/workaround.hpp>
@@ -28,11 +29,6 @@
namespace boost { namespace parameter { namespace aux {
struct empty_arg_list;
struct arg_list_tag;
struct tagged_argument_base {};
// Holds a reference to an argument of type Arg associated with
// keyword Keyword
@@ -206,21 +202,6 @@ public:
typedef arg_list_tag tag; // For dispatching to sequence intrinsics
};
// Defines a metafunction, is_tagged_argument, that identifies
// tagged_argument specializations and their derived classes.
template <class T>
struct is_tagged_argument_aux
: is_convertible<T*,tagged_argument_base const*>
{};
template <class T>
struct is_tagged_argument
: mpl::and_<
mpl::not_<is_lvalue_reference<T> >
, is_tagged_argument_aux<T>
>
{};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP

View File

@@ -0,0 +1,16 @@
// 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_TAGGED_ARGUMENT_FWD_HPP
#define BOOST_PARAMETER_TAGGED_ARGUMENT_FWD_HPP
namespace boost { namespace parameter { namespace aux {
template <class Keyword, class Arg>
class tagged_argument;
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,17 @@
// 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_USE_DEFAULT_HPP
#define BOOST_PARAMETER_AUX_USE_DEFAULT_HPP
namespace boost { namespace parameter { namespace aux {
struct use_default
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,21 @@
// 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_USE_DEFAULT_TAG_HPP
#define BOOST_PARAMETER_USE_DEFAULT_TAG_HPP
namespace boost { namespace parameter { namespace aux {
struct use_default_tag
{
inline use_default_tag operator()() const
{
return *this;
}
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -1,6 +1,6 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// 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_VOID_050329_HPP
@@ -8,22 +8,31 @@
namespace boost { namespace parameter {
// A placemarker for "no argument passed."
// MAINTAINER NOTE: Do not make this into a metafunction
struct void_ {};
namespace aux
{
inline void_& void_reference()
{
static void_ instance;
return instance;
}
} // namespace aux
// A placemarker for "no argument passed."
// MAINTAINER NOTE: Do not make this into a metafunction
struct void_
{
};
}} // namespace boost::parameter
#endif // BOOST_PARAMETER_VOID_050329_HPP
namespace boost { namespace parameter { namespace aux {
inline ::boost::parameter::void_& void_reference()
{
static ::boost::parameter::void_ instance;
return instance;
}
}}} // namespace boost::parameter::aux
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
namespace boost { namespace parameter { namespace aux {
typedef void* voidstar;
}}} // namespace boost::parameter::aux
#endif
#endif // include guard

View File

@@ -0,0 +1,92 @@
// 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_DEDUCED_HPP
#define BOOST_PARAMETER_DEDUCED_HPP
#include <boost/parameter/aux_/use_default.hpp>
namespace boost { namespace parameter {
// This metafunction can be used to describe the treatment of particular
// named parameters for the purposes of overload elimination with SFINAE,
// by placing specializations in the parameters<...> list.
//
// If a keyword k is specified with deduced<...>, that keyword
// will be automatically deduced from the argument list.
template <typename Tag>
struct deduced
{
typedef Tag key_type;
};
}}
#include <boost/mpl/bool.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_deduced_aux : ::boost::mpl::false_
{
};
template <typename Tag>
struct is_deduced_aux< ::boost::parameter::deduced<Tag> >
: ::boost::mpl::true_
{
};
template <typename T>
struct is_deduced0
: ::boost::parameter::aux::is_deduced_aux<typename T::key_type>::type
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace parameter { namespace aux {
//
// tag_type, has_default, and predicate --
//
// These metafunctions accept a ParameterSpec and extract the
// keyword tag, whether or not a default is supplied for the
// parameter, and the predicate that the corresponding actual
// argument type is required match.
//
// a ParameterSpec is a specialization of either keyword<...>,
// required<...>, optional<...>
//
template <typename T>
struct has_default
: ::boost::mpl::if_<
::boost::parameter::aux::is_required<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>::type
{
};
template <typename T>
struct is_deduced
: ::boost::mpl::if_<
typename ::boost::mpl::if_<
::boost::parameter::aux::is_optional<T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_required<T>
>::type
, ::boost::parameter::aux::is_deduced0<T>
, ::boost::mpl::false_
>::type
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -6,6 +6,7 @@
#ifndef KEYWORD_050328_HPP
#define KEYWORD_050328_HPP
#include <boost/parameter/keyword_fwd.hpp>
#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
#include <boost/parameter/aux_/tag.hpp>
#include <boost/parameter/aux_/default.hpp>

View File

@@ -0,0 +1,16 @@
// 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_KEYWORD_FWD_HPP
#define BOOST_PARAMETER_KEYWORD_FWD_HPP
namespace boost { namespace parameter {
template <class Tag>
struct keyword;
}} // namespace boost::parameter
#endif // include guard

View File

@@ -1,78 +1,15 @@
// Copyright Daniel Wallin 2006. Use, modification and distribution is
// subject to 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)
// 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_NAME_060806_HPP
# define BOOST_PARAMETER_NAME_060806_HPP
#define BOOST_PARAMETER_NAME_060806_HPP
# include <boost/parameter/keyword.hpp>
# include <boost/parameter/value_type.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/stringize.hpp>
# include <boost/preprocessor/control/iif.hpp>
# include <boost/preprocessor/tuple/eat.hpp>
# include <boost/preprocessor/tuple/elem.hpp>
# include <boost/mpl/placeholders.hpp>
# if !defined(BOOST_NO_SFINAE) \
&& !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
# include <boost/utility/enable_if.hpp>
# include <boost/mpl/lambda.hpp>
namespace boost { namespace parameter { namespace aux {
// Tag type passed to MPL lambda.
struct lambda_tag;
struct name_tag_base
{};
template <class Tag>
struct name_tag
{};
template <class T>
struct is_name_tag
: mpl::false_
{};
}}} // namespace boost::parameter::aux
namespace boost { namespace mpl {
template <class T>
struct lambda<
T
, typename boost::enable_if<
parameter::aux::is_name_tag<T>, parameter::aux::lambda_tag
>::type
>
{
typedef true_ is_le;
typedef bind3< quote3<parameter::value_type>, arg<2>, T, void> result_;
typedef result_ type;
};
}} // namespace boost::mpl
# endif
# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
# include <boost/preprocessor/detail/split.hpp>
// From Paul Mensonides
# define BOOST_PARAMETER_IS_BINARY(x) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_BINARY_C x BOOST_PP_COMMA() 0) \
/**/
# define BOOST_PARAMETER_IS_BINARY_C(x,y) \
~, 1 BOOST_PP_RPAREN() \
BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~ \
/**/
# else
# include <boost/preprocessor/detail/is_binary.hpp>
# define BOOST_PARAMETER_IS_BINARY(x) BOOST_PP_IS_BINARY(x)
# endif
#include <boost/parameter/aux_/name.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/keyword.hpp>
#include <boost/preprocessor/stringize.hpp>
# define BOOST_PARAMETER_BASIC_NAME(tag_namespace, tag, name) \
namespace tag_namespace \
@@ -84,13 +21,9 @@ struct lambda<
return BOOST_PP_STRINGIZE(tag); \
} \
\
typedef boost::parameter::value_type< \
boost::mpl::_2, tag, boost::parameter::void_ \
> _; \
typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag) _; \
\
typedef boost::parameter::value_type< \
boost::mpl::_2, tag, boost::parameter::void_ \
> _1; \
typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag) _1; \
}; \
} \
namespace \
@@ -102,6 +35,8 @@ struct lambda<
# define BOOST_PARAMETER_COMPLEX_NAME_TUPLE1(tag,namespace) \
(tag, namespace), ~
#include <boost/preprocessor/tuple/elem.hpp>
# define BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name) \
BOOST_PP_TUPLE_ELEM(2, 0, (BOOST_PARAMETER_COMPLEX_NAME_TUPLE1 name))
@@ -111,6 +46,8 @@ struct lambda<
# define BOOST_PARAMETER_COMPLEX_NAME_NAMESPACE(name) \
BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PARAMETER_COMPLEX_NAME_TUPLE(name))
#include <boost/preprocessor/tuple/eat.hpp>
# define BOOST_PARAMETER_COMPLEX_NAME(name) \
BOOST_PARAMETER_BASIC_NAME( \
BOOST_PARAMETER_COMPLEX_NAME_NAMESPACE(name) \
@@ -119,9 +56,14 @@ struct lambda<
) \
/**/
#include <boost/preprocessor/cat.hpp>
# define BOOST_PARAMETER_SIMPLE_NAME(name) \
BOOST_PARAMETER_BASIC_NAME(tag, name, BOOST_PP_CAT(_, name))
#include <boost/parameter/aux_/preprocessor/is_binary.hpp>
#include <boost/preprocessor/control/iif.hpp>
# define BOOST_PARAMETER_NAME(name) \
BOOST_PP_IIF( \
BOOST_PARAMETER_IS_BINARY(name) \
@@ -130,6 +72,7 @@ struct lambda<
)(name) \
/**/
#include <boost/parameter/aux_/template_keyword.hpp>
# define BOOST_PARAMETER_TEMPLATE_KEYWORD(name) \
namespace tag \

View File

@@ -0,0 +1,52 @@
// 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_OPTIONAL_HPP
#define BOOST_PARAMETER_OPTIONAL_HPP
#include <boost/parameter/aux_/use_default.hpp>
namespace boost { namespace parameter {
// This metafunction can be used to describe the treatment of particular
// named parameters for the purposes of overload elimination with SFINAE,
// by placing specializations in the parameters<...> list. In order for
// a treated function to participate in overload resolution:
//
// - The actual argument type matched by every keyword tag
// associated with a predicate must satisfy that predicate
//
// - If a keyword k is specified without an optional<...> or
// required<...> wrapper, it is treated as though
// optional<k> were specified.
template <
typename Tag
, typename Predicate = ::boost::parameter::aux::use_default
>
struct optional
{
typedef Tag key_type;
typedef Predicate predicate;
};
}}
#include <boost/mpl/bool.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_optional : ::boost::mpl::false_
{
};
template <typename Tag, typename Predicate>
struct is_optional< ::boost::parameter::optional<Tag,Predicate> >
: ::boost::mpl::true_
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
// 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_REQUIRED_HPP
#define BOOST_PARAMETER_REQUIRED_HPP
#include <boost/parameter/aux_/use_default.hpp>
namespace boost { namespace parameter {
// This metafunction can be used to describe the treatment of particular
// named parameters for the purposes of overload elimination with SFINAE,
// by placing specializations in the parameters<...> list. In order for
// a treated function to participate in overload resolution:
//
// - all keyword tags wrapped in required<...> must have a matching
// actual argument
//
// - The actual argument type matched by every keyword tag
// associated with a predicate must satisfy that predicate
template <
typename Tag
, typename Predicate = ::boost::parameter::aux::use_default
>
struct required
{
typedef Tag key_type;
typedef Predicate predicate;
};
}}
#include <boost/mpl/bool.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_required : ::boost::mpl::false_
{
};
template <typename Tag, typename Predicate>
struct is_required< ::boost::parameter::required<Tag,Predicate> >
: ::boost::mpl::true_
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -4,6 +4,7 @@
#include <boost/parameter/preprocessor.hpp>
#include <boost/parameter/keyword.hpp>
#include <boost/parameter/binding.hpp>
#include <boost/type_traits/is_const.hpp>
#include <string>
#include "basics.hpp"