The Boost Parameter Library Reference Documentation

Authors: David Abrahams
Daniel Wallin
Contact: dave@boost-consulting.com, daniel@boostpro.com
Organization: BoostPro Computing
Date: 2005-07-17
Copyright: Copyright David Abrahams, Daniel Wallin 2005-2009. 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)

Boost


Contents


1   Preliminaries

This section covers some basic information you'll need to know in order to understand this reference

1.1   Namespaces

In this document, all unqualified identifiers should be assumed to be defined in namespace boost::parameter unless otherwise specified.

1.2   Exceptions

No operation described in this document throws an exception unless otherwise specified.

1.3   Thread Safety

All components of this library can be used safely from multiple threads without synchronization.1

1.4   Typography

Names written in sans serif type represent concepts.

In code blocks, italic type represents unspecified text that satisfies the requirements given in the detailed description that follows the code block.

In a specification of the tokens generated by a macro, bold type is used to highlight the position of the expanded macro argument in the result.

The special character β represents the value of BOOST_PARAMETER_MAX_ARITY.


2   Terminology

keyword
The name of a function parameter.
keyword tag type
A type used to uniquely identify a function parameter. Typically its name will be the same as that of the parameter.
positional argument
An argument passed with no explicit keyword. Its parameter is determined in the usual C++ way: by position with respect to a parameter list.
tag type
Shorthand for “keyword tag type.”
keyword object
An instance of keyword <T> for some tag type T.
tagged reference

An object whose type is associated with a keyword tag type (the object's keyword), and that holds a reference (to the object's value).

As a shorthand, a “tagged reference to x” means a tagged reference whose value is x.

tagged default
A tagged reference whose value represents the value of a default argument.
tagged lazy default
A tagged reference whose value, when invoked with no arguments, computes a default argument value.
intended argument type
The intended argument type of a single-element ArgumentPack is the type of its element's value. The intended argument type of any other type X is X itself.

Note

In this reference, we will use concept names (and other names) to describe both types and objects, depending on context. So for example, “an ArgumentPack” can refer to a type that models ArgumentPack or an object of such a type.


3   Concepts

This section describes the generic type concepts used by the Parameter library.

3.1   ArgumentPack

An ArgumentPack is a collection of tagged references to the actual arguments passed to a function. Every ArgumentPack is also a valid MPL Forward Sequence and MPL Associative Sequence consisting of the keyword tag types in its tagged references.

Requirements

In the table below,

Any exceptions are thrown from the invocation of w's value will be propagated to the caller.

ArgumentPack requirements
Expression Type Requirements Semantics/Notes
x[u] binding<A,K>::type x contains an element b whose keyword is K Returns b's value (by reference).
x[u] binding<A,L,D>::type none If x contains an element b whose keyword is the same as u's, returns b's value (by reference). Otherwise, returns u's value.
x[w] lazy_binding<A,M,E>::type none If x contains an element b whose keyword is the same as w's, returns b's value (by reference). Otherwise, invokes w's value and returns the result.
x, z Model of ArgumentPack none Returns an ArgumentPack containing all the elements of both x and z.

3.2   ParameterSpec

A ParameterSpec describes the type requirements for arguments corresponding to a given keyword and indicates whether the argument is optional or required. The table below details the allowed forms and describes their condition for satisfaction by an actual argument type. In each row,

ParameterSpec allowed forms and conditions of satisfaction
Type A required Condition A must satisfy
K no n/a
optional<K,F> no mpl::apply2<F,A,P>::type::value is true.
required<K,F> yes mpl::apply2<F,A,P>::type::value is true.

The information in a ParameterSpec is used to limit the arguments that will be matched by forwarding functions.


4   Class Templates

4.1   keyword

The type of every keyword object is a specialization of keyword.

Defined in:boost/parameter/keyword.hpp

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

template <typename Tag>
struct keyword
{
    typedef Tag tag;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            boost::is_scalar<T>
          , boost::mpl::true_
          , boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::in_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
        >::type
      , ArgumentPack
    >::type constexpr
        operator=(T const& value) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            typename boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::out_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
          , boost::mpl::if_<
                boost::is_const<T>
              , boost::mpl::false_
              , boost::mpl::true_
            >
          , boost::mpl::false_
        >::type
      , ArgumentPack
    >::type constexpr
        operator=(T& value) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            boost::is_scalar<T>
          , boost::mpl::false_
          , boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::in_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
        >::type
      , ArgumentPack
    >::type constexpr
        operator=(T const&& value) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            boost::is_scalar<T>
          , boost::mpl::false_
          , boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::consume_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
        >::type
      , ArgumentPack
    >::type constexpr
        operator=(T&& value) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            boost::is_scalar<T>
          , boost::mpl::true_
          , boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::in_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
        >::type
      , tagged default
    >::type constexpr
        operator|(T const& x) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            typename boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::out_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
          , boost::mpl::if_<
                boost::is_const<T>
              , boost::mpl::false_
              , boost::mpl::true_
            >
          , boost::mpl::false_
        >::type
      , tagged default
    >::type constexpr
        operator|(T& x) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            boost::is_scalar<T>
          , boost::mpl::false_
          , boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::in_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
        >::type
      , tagged default
    >::type constexpr
        operator|(T const&& x) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            boost::is_scalar<T>
          , boost::mpl::false_
          , boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::consume_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
        >::type
      , tagged default
    >::type constexpr
        operator|(T&& x) const;

    template <typename F>
    tagged lazy default operator||(F const&) const;

    template <typename F>
    tagged lazy default operator||(F&) const;

    static keyword<Tag> const& instance;

    static keyword<Tag>& get();
};

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is not #defined, then:

template <typename Tag>
struct keyword
{
    typedef Tag tag;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            boost::is_scalar<T>
          , boost::mpl::true_
          , boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::in_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
        >::type
      , ArgumentPack
    >::type constexpr
        operator=(T const& value) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            typename boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::out_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
          , boost::mpl::if_<
                boost::is_const<T>
              , boost::mpl::false_
              , boost::mpl::true_
            >
          , boost::mpl::false_
        >::type
      , ArgumentPack
    >::type constexpr
        operator=(T& value) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            boost::is_scalar<T>
          , boost::mpl::true_
          , boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::in_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
        >::type
      , tagged default
    >::type constexpr
        operator|(T const& x) const;

    template <typename T>
    typename boost::enable_if<
        typename boost::mpl::eval_if<
            typename boost::mpl::eval_if<
                boost::is_same<
                    typename Tag::qualifier
                  , boost::parameter::out_reference
                >
              , boost::mpl::true_
              , boost::mpl::if_<
                    boost::is_same<
                        typename Tag::qualifier
                      , boost::parameter::forward_reference
                    >
                  , boost::mpl::true_
                  , boost::mpl::false_
                >
            >
          , boost::mpl::if_<
                boost::is_const<T>
              , boost::mpl::false_
              , boost::mpl::true_
            >
          , boost::mpl::false_
        >::type
      , tagged default
    >::type constexpr
        operator|(T& x) const;

    template <typename F>
    tagged lazy default operator||(F const&) const;

    template <typename F>
    tagged lazy default operator||(F&) const;

    static keyword<Tag> const& instance;

    static keyword<Tag>& get();
};
operator=
template <typename T> ArgumentPack operator=(T const& value) const;
template <typename T> ArgumentPack operator=(T& value) const;

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

template <typename T> ArgumentPack operator=(T const&& value) const;
template <typename T> ArgumentPack operator=(T&& value) const;
Requires: one of the following:
  • The nested qualifier type of Tag must be forward_reference.
  • To use the const lvalue reference overload, T must be scalar, or the nested qualifier type of Tag must be in_reference.
  • To use the mutable lvalue reference overload, the nested qualifier type of Tag must be out_reference or in_out_reference, and T must not be const-qualified.
  • To use the const rvalue reference overload for non-scalar T, the nested qualifier type of Tag must be in_reference.
  • To use the mutable rvalue reference overload for non-scalar T, the nested qualifier type of Tag must be consume_reference or move_from_reference.
Returns: an ArgumentPack containing a single tagged reference to value with keyword Tag
operator|
template <typename T> tagged default operator|(T const& x) const;
template <typename T> tagged default operator|(T& x) const;

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

template <typename T> tagged default operator|(T const&& x) const;
template <typename T> tagged default operator|(T&& x) const;
Requires: one of the following:
  • The nested qualifier type of Tag must be forward_reference.
  • To use the const lvalue reference overload, T must be scalar, or the nested qualifier type of Tag must be in_reference.
  • To use the mutable lvalue reference overload, the nested qualifier type of Tag must be out_reference or in_out_reference, and T must not be const-qualified.
  • To use the const rvalue reference overload for non-scalar T, the nested qualifier type of Tag must be in_reference.
  • To use the mutable rvalue reference overload for non-scalar T, the nested qualifier type of Tag must be consume_reference or move_from_reference.
Returns: a tagged default with value x and keyword Tag.
operator||
template <typename F> tagged lazy default operator||(F const& g) const;
template <typename F> tagged lazy default operator||(F& g) const;
Requires: g() is valid, with type boost::result_of<F()>::type.2
Returns: a tagged lazy default with value g and keyword Tag.
instance
static keyword<Tag> const& instance;
Returns: a “singleton instance”: the same object will be returned on each invocation of instance.
Thread Safety: instance can be accessed from multiple threads simultaneously.
get
static keyword<Tag>& get();

Deprecated

This macro has been deprecated in favor of instance.

Returns: a “singleton instance”: the same object will be returned on each invocation of get().
Thread Safety: get() can be called from multiple threads simultaneously.

4.2   template_keyword

This class template encapsulates a named template parameter. Every type generated by the BOOST_PARAMETER_TEMPLATE_KEYWORD macro is a specialization of template_keyword.

Defined in: boost/parameter/template_keyword.hpp
template <typename Tag, typename T>
struct template_keyword
{
    typedef Tag key_type;
    typedef T value_type;
    typedef implementation defined reference;
};

The test/ntp.cpp test program demonstrates proper usage of this class template.

4.3   parameters

Provides an interface for assembling the actual arguments to a forwarding function into an ArgumentPack, in which any positional arguments will be tagged according to the corresponding template argument to parameters.

Defined in: boost/parameter/parameters.hpp

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

template <typename ...PSpec>
struct parameters
{
    template <typename ...Args>
    struct match
    {
        typedef … type;
    };

    template <typename ...Args>
    ArgumentPack operator()(Args&... args) const;
};
Requires: Each element in the PSpec parameter pack must be a model of ParameterSpec.

Note

In this section, R ## i and K ## i are defined as follows: for any argument type A ## i:

let D0 the set [d0, …, d ## j] of all deduced parameter specs in the PSpec parameter pack
R ## i is the intended argument type of A ## i

if A ## i is a result type of keyword<T>::operator=
then
K ## i is T
else
if some A ## j where ji is a result type of keyword<T>::operator=
or some P ## j in ji is deduced
then
if some parameter spec dj in D ## i matches Ai
then
K ## i is d ## j's keyword tag type.
Di+1 is D ## i - [d ## j]
else
K ## i is P ## i's keyword tag type.

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is not #defined, then:

template <
    typename P0 = unspecified
  , typename P1 = unspecified
  , …
  , typename P ## β = unspecified
>
struct parameters
{
    template <
        typename A0
      , typename A1 = unspecified
      , …
      , typename A ## β = unspecified
    >
    struct match
    {
        typedef … type;
    };

    template <typename A0>
    ArgumentPack operator()(A0& a0) const;

    template <typename A0, typename A1>
    ArgumentPack operator()(A0& a0, A1& a1) const;

    

    template <typename A0, typename A1, …, typename A ## β>
    ArgumentPack
    operator()(A0& a0, A1& a1, …, A ## β & a ## β) const;
};
Requires: P0, P1, …, P ## β are models of ParameterSpec.

Note

In this section, R ## i and K ## i are defined as follows: for any argument type A ## i:

let D0 the set [d0, …, d ## j] of all deduced parameter specs in [P0, …, P ## β]
R ## i is the intended argument type of A ## i

if A ## i is a result type of keyword<T>::operator=
then
K ## i is T
else
if some A ## j where ji is a result type of keyword<T>::operator=
or some P ## j in ji is deduced
then
if some parameter spec dj in D ## i matches Ai
then
K ## i is d ## j's keyword tag type.
Di+1 is D ## i - [d ## j]
else
K ## i is P ## i's keyword tag type.
match

A Metafunction used to remove a forwarding function from overload resolution.

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

Returns: if all elements in Params... are satisfied (see below), then parameters<Params...>. Otherwise, match<Args...>::type is not defined.

Each element P in Params is satisfied if either:

  • P is the unspecified default
  • or, P is a keyword tag type
  • or, P is optional<X,F> and either
    • X is not K ## i for any i,
    • or X is some K ## i and mpl::apply<F,R ## i>::type::value is true
  • or, P is required<X,F>, and
    • X is some K ## i, and
    • mpl::apply<F,R ## i>::type::value is true

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is not #defined, then:

Returns: if P0, P1, …, are satisfied (see below), then parameters<P0,P1,…,Pβ>. Otherwise, match<A0,A1,…,Aβ>::type is not defined.

P0, P1, …, are satisfied if, for every j in 0…β, either:

  • P ## j is the unspecified default
  • or, P ## j is a keyword tag type
  • or, P ## j is optional<X,F> and either
    • X is not K ## i for any i,
    • or X is some K ## i and mpl::apply<F,R ## i>::type::value is true
  • or, P ## j is required<X,F>, and
    • X is some K ## i, and
    • mpl::apply<F,R ## i>::type::value is true
operator()

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

template <typename ...Args> ArgumentPack operator()(Args&&... args) const;

Else:

template <typename A0> ArgumentPack operator()(A0 const& a0) const;



template <typename A0, …, typename A ## β> ArgumentPack operator()(A0 const& a0, …, A ## β const& a ## β) const;
Returns:

An ArgumentPack containing, for each a ## i,

  • if a ## i is a single-element ArgumentPack, its element
  • Otherwise, a tagged reference with keyword K ## i and value a ## i

4.4   optional, required

These templates describe the requirements on a function parameter.

optional is defined in: boost/parameter/optional.hpp.

required is defined in: boost/parameter/required.hpp.

Both headers are included by: boost/parameter/parameters.hpp

Specializations model:
  ParameterSpec
template <typename Tag, typename Predicate = unspecified>
struct optional;

template <typename Tag, typename Predicate = unspecified>
struct required;

The default value of Predicate is an unspecified MPL Binary Metafunction Class that returns mpl::true_ for any argument.

4.5   deduced

This template is used to wrap the keyword tag argument to optional or required.

Defined in: boost/parameter/deduced.hpp
Included by: boost/parameter/parameters.hpp
template <typename Tag>
struct deduced;

5   Metafunctions

A Metafunction is conceptually a function that operates on, and returns, C++ types.

5.1   binding

Returns the result type of indexing an argument pack with a keyword tag type or with a tagged default.

Defined in: boost/parameter/binding.hpp
template <typename A, typename K, typename D = void_>
struct binding
{
    typedef … type;
};
Requires: A is a model of ArgumentPack.
Returns: the reference type of the tagged reference in A having keyword tag type K, if any. If no such tagged reference exists, returns D.

5.2   lazy_binding

Returns the result type of indexing an argument pack with a tagged lazy default.

Defined in: boost/parameter/binding.hpp
template <typename A, typename K, typename F>
struct lazy_binding
{
    typedef … type;
};
Requires: A is a model of ArgumentPack.
Returns: the reference type of the tagged reference in A having keyword tag type K, if any. If no such tagged reference exists, returns boost::result_of<F()>::type.2

5.3   value_type

Returns the result type of indexing an argument pack with a keyword tag type or with a tagged default.

Defined n: boost/parameter/value_type.hpp
template <typename A, typename K, typename D = void_>
struct value_type
{
    typedef … type;
};
Requires:

A is a model of ArgumentPack.

Returns:

the type of the tagged reference in A having keyword tag type K, if any. If no such tagged reference exists, returns D. Equivalent to:

typename remove_reference<
    typename binding<A, K, D>::type
>::type

… when D is not a reference type.

5.4   is_argument_pack

Defined in: boost/parameter/is_argument_pack.hpp
template <typename T>
struct is_argument_pack  // : mpl::true_ or mpl::false_
{
};
Returns: mpl::true_ if T is a model of ArgumentPack, mpl::false_ otherwise. exists, returns D.

6   Code Generation Macros

Macros in this section can be used to ease the writing of code using the Parameter libray by eliminating repetitive boilerplate.

6.1   BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, arguments)

Defined in: boost/parameter/preprocessor.hpp
Requires:
 

result is the parenthesized return type of the function. name is the base name of the function, this is the name of the generated forwarding functions. tag_namespace is the namespace in which the keywords used by the function resides. arguments is a list of argument specifiers, as defined below.

Argument specifiers syntax:
 
argument-specifiers ::= specifier-group0 {specifier-group0}

specifier-group0 ::= specifier-group1 |
    (
        '(' 'deduced'
            specifier-group1 {specifier-group1}
        ')'
    )

specifier-group1 ::=
    (
        '(' 'optional'
            optional-specifier {optional-specifier}
        ')'
    ) | (
        '(' 'required'
            required-specifier {required-specifier}
        ')'
    )

optional-specifier ::=
    '('
        argument-name ',' restriction ',' default-value
    ')'

required-specifier ::=
    '(' argument-name ',' restriction ')'

restriction ::=
    ( '*' '(' mfc ')' ) |
    ( '(' typename ')' ) |
    '*'
  • argument-name is any valid C++ identifier.
  • default-value is any valid C++ expression; if necessary, user code can compute it in terms of previous-name ## _type, where previous-name is the argument-name in a previous specifier-group0 or specifier-group1. This expression will be invoked exactly once.
  • mfc is an MPL Binary Metafunction Class whose first argument will be the type of the corresponding argument-name, whose second argument will be the entire ArgumentPack, and whose return type is a Boolean Integral Concept; however, user code cannot compute mfc in terms of previous-name ## _type.
  • type-name is either the name of a target type or an MPL Binary Metafunction Class whose first argument will be the type of the corresponding argument-name, whose second argument will be the entire ArgumentPack, and whose return type is the target type. If restriction uses this form, then the type of the generated name argument-name ## _type will be computed in terms of the target type, and the generated reference argument-name (but not its corresponding entry in args) will be cast to that type.
Generated names in enclosing scope:
 
  • boost_param_result_ ## __LINE__ ## name
  • boost_param_params_ ## __LINE__ ## name
  • boost_param_parameters_ ## __LINE__ ## name
  • boost_param_impl ## name
  • boost_param_dispatch_0boost_ ## __LINE__ ## name
  • boost_param_dispatch_1boost_ ## __LINE__ ## name
Approximate expansion:

Where:

  • n denotes the minimum arity, as determined from arguments.
  • m denotes the maximum arity, as determined from arguments.

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

template <typename T>
struct boost_param_result_ ## __LINE__ ## name
{
    typedef result type;
};

struct boost_param_params_ ## __LINE__ ## name
  : boost::parameter::parameters<
        list of parameter specifications, based on arguments
    >
{
};

typedef boost_param_params_ ## __LINE__ ## name
    boost_param_parameters_ ## __LINE__ ## name;

template <typename Args>
typename boost_param_result_ ## __LINE__ ## name<Args>::type
    boost_param_impl ## name(Args const&);

template <typename A0, …, typename A ## n>
result type
    name(
        A0&& a0, …, A ## n && a ## n
      , typename boost_param_parameters_ ## __LINE__ ## name::match<
            A0, …, A ## n
        >::type = boost_param_parameters_ ## __LINE__ ## name()
    )
{
    return boost_param_impl ## name(
        boost_param_parameters_ ## __LINE__ ## name()(
            std::forward<A0>(a0)
          , …
          , std::forward<A ## n>(a ## n)
        )
    );
}



template <typename A0, …, typename A ## m>
result type
    name(
        A0&& a0, …, A ## m && a ## m
      , typename boost_param_parameters_ ## __LINE__ ## name::match<
            A0, …, A ## m
        >::type = boost_param_parameters_ ## __LINE__ ## name()
    )
{
    return boost_param_impl ## name(
        boost_param_parameters_ ## __LINE__ ## name()(
            std::forward<A0>(a0)
          , …
          , std::forward<A ## m>(a ## m)
        )
    );
}

template <
    typename ResultType
  , typename Args
  , typename argument name ## 0 ## _type
  , …
  , typename argument name ## n ## _type
>
ResultType
    boost_param_dispatch_0boost_ ## __LINE__ ## name(
        (ResultType(*)())
      , Args const& args
      , argument name ## 0 ## _type&& argument name ## 0
      , …
      , argument name ## n ## _type&& argument name ## n
    );



template <
    typename ResultType
  , typename Args
  , typename argument name ## 0 ## _type
  , …
  , typename argument name ## m ## _type
>
ResultType
    boost_param_dispatch_0boost_ ## __LINE__ ## name(
        (ResultType(*)())
      , Args const& args
      , argument name ## 0 ## _type&& argument name ## 0
      , …
      , argument name ## m ## _type&& argument name ## m
    );

template <typename Args>
typename boost_param_result_ ## __LINE__ ## name<Args>::type
    boost_param_impl ## name(Args const& args)
{
    return boost_param_dispatch_0boost_ ## __LINE__ ## name(
        static_cast<ResultType(*)()>(std::nullptr)
      , args
      , std::forward<
            typename boost::parameter::value_type<
                Args
              , keyword tag type of required parameter ## 0
            >::type
        >(args[ keyword object of required parameter ## 0])
      , …
      , std::forward<
            typename boost::parameter::value_type<
                Args
              , keyword tag type of required parameter ## n
            >::type
        >(args[ keyword object of required parameter ## n])
    );
}

template <
    typename ResultType
  , typename Args
  , typename argument name ## 0 ## _type
  , …
  , typename argument name ## n ## _type
>
ResultType
    boost_param_dispatch_0boost_ ## __LINE__ ## name(
        (ResultType(*)())
      , Args const& args
      , argument name ## 0 ## _type&& argument name ## 0
      , …
      , argument name ## n ## _type&& argument name ## n
    )
{
    return boost_param_dispatch_0boost_ ## __LINE__ ## name(
        static_cast<ResultType(*)()>(std::nullptr)
      , (args, keyword object of optional parameter ## n + 1 =
            default value of optional parameter ## n + 1
        )
      , std::forward< argument name ## 0 ## _type>(
            argument name ## 0
        )
      , …
      , std::forward< argument name ## n ## _type>(
            argument name ## n
        )
      , std::forward<
            typename boost::parameter::value_type<
                Args
              , keyword tag type of optional parameter ## n + 1
            >::type
        >(default value of optional parameter ## n + 1)
    );
}



template <
    typename ResultType
  , typename Args
  , typename argument name ## 0 ## _type
  , …
  , typename argument name ## m ## _type
>
ResultType
    boost_param_dispatch_0boost_ ## __LINE__ ## name(
        (ResultType(*)())
      , Args const& args
      , argument name ## 0 ## _type&& argument name ## 0
      , …
      , argument name ## m ## _type&& argument name ## m
    )

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is not #defined, then:

template <typename T>
struct boost_param_result_ ## __LINE__ ## name
{
    typedef result type;
};

struct boost_param_params_ ## __LINE__ ## name
  : boost::parameter::parameters<
        list of parameter specifications, based on arguments
    >
{
};

typedef boost_param_params_ ## __LINE__ ## name
    boost_param_parameters_ ## __LINE__ ## name;

template <typename Args>
typename boost_param_result_ ## __LINE__ ## name<Args>::type
    boost_param_impl ## name(Args const&);

template <typename A0, …, typename A ## n>
result type
    name(
        A0 const& a0, …, A ## n const& a ## n
      , typename boost_param_parameters_ ## __LINE__ ## name::match<
            A0 const, …, A ## n const
        >::type = boost_param_parameters_ ## __LINE__ ## name()
    )
{
    return boost_param_impl ## name(
        boost_param_parameters_ ## __LINE__ ## name()(
            a0, …, a ## n
        )
    );
}

… exponential number of overloads …


template <typename A0, …, typename A ## n>
result type
    name(
        A0& a0, …, A ## n & a ## n
      , typename boost_param_parameters_ ## __LINE__ ## name::match<
            A0, …, A ## n
        >::type = boost_param_parameters_ ## __LINE__ ## name()
    )
{
    return boost_param_impl ## name(
        boost_param_parameters_ ## __LINE__ ## name()(
            a0, …, a ## n
        )
    );
}



template <typename A0, …, typename A ## m>
result type
    name(
        A0 const& a0, …, A ## m const& ## ; am
      , typename boost_param_parameters_ ## __LINE__ ## name::match<
            A0 const, …, A ## m const
        >::type = boost_param_parameters_ ## __LINE__ ## name()
    )
{
    return boost_param_impl ## name(
        boost_param_parameters_ ## __LINE__ ## name()(
            a0, …, a ## m
        )
    );
}

… exponential number of overloads …


template <typename A0, …, typename A ## m>
result type
    name(
        A0& a0, …, A ## m & ## ; am
      , typename boost_param_parameters_ ## __LINE__ ## name::match<
            A0, …, A ## m
        >::type = boost_param_parameters_ ## __LINE__ ## name()
    )
{
    return boost_param_impl ## name(
        boost_param_parameters_ ## __LINE__ ## name()(
            a0, …, a ## m
        )
    );
}

template <
    typename ResultType
  , typename Args
  , typename argument name ## 0 ## _type
  , …
  , typename argument name ## n ## _type
>
ResultType
    boost_param_dispatch_0boost_ ## __LINE__ ## name(
        (ResultType(*)())
      , Args const& args
      , argument name ## 0 ## _type& argument name ## 0
      , …
      , argument name ## n ## _type& argument name ## n
    );



template <
    typename ResultType
  , typename Args
  , typename argument name ## 0 ## _type
  , …
  , typename argument name ## m ## _type
>
ResultType
    boost_param_dispatch_0boost_ ## __LINE__ ## name(
        (ResultType(*)())
      , Args const& args
      , argument name ## 0 ## _type& argument name ## 0
      , …
      , argument name ## m ## _type& argument name ## m
    );

template <typename Args>
typename boost_param_result_ ## __LINE__ ## name<Args>::type
    boost_param_impl ## name(Args const& args)
{
    return boost_param_dispatch_0boost_ ## __LINE__ ## name(
        static_cast<ResultType(*)()>(std::nullptr)
      , args
      , args[ keyword object of required parameter ## 0]
      , …
      , args[ keyword object of required parameter ## n]
    );
}

template <
    typename ResultType
  , typename Args
  , typename argument name ## 0 ## _type
  , …
  , typename argument name ## n ## _type
>
ResultType
    boost_param_dispatch_0boost_ ## __LINE__ ## name(
        (ResultType(*)())
      , Args const& args
      , argument name ## 0 ## _type& argument name ## 0
      , …
      , argument name ## n ## _type& argument name ## n
    )
{
    return boost_param_dispatch_0boost_ ## __LINE__ ## name(
        static_cast<ResultType(*)()>(std::nullptr)
      , (args, keyword object of optional parameter ## n + 1 =
            default value of optional parameter ## n + 1
        )
      , argument name ## 0
      , …
      , argument name ## n
      , default value of optional parameter ## n + 1
    );
}



template <
    typename ResultType
  , typename Args
  , typename argument name ## 0 ## _type
  , …
  , typename argument name ## m ## _type
>
ResultType
    boost_param_dispatch_0boost_ ## __LINE__ ## name(
        (ResultType(*)())
      , Args const& args
      , argument name ## 0 ## _type& argument name ## 0
      , …
      , argument name ## m ## _type& argument name ## m
    )

The test/preprocessor.cpp, test/preprocessor_deduced.cpp, and test/preprocessor_eval_category.cpp test programs demonstrate proper usage of this macro.

6.2   BOOST_PARAMETER_MEMBER_FUNCTION(result, name, tag_namespace, arguments)

Defined in: boost/parameter/preprocessor.hpp

Same as BOOST_PARAMETER_FUNCTION, except:

  • name may be qualified by the static keyword to declare the member function and its helpers as not associated with any object of the enclosing type.
  • Expansion of this macro omits all forward declarations of the front-end implementation and dispatch functions.

The test/preprocessor.cpp and test/preprocessor_eval_category.cpp test programs demonstrate proper usage of this macro.

6.3   BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, tag_namespace, arguments)

Defined in: boost/parameter/preprocessor.hpp

Same as BOOST_PARAMETER_MEMBER_FUNCTION, except that the overloaded forwarding member functions and their helper methods are const-qualified.

The test/preprocessor.cpp test program demonstrates proper usage of this macro.

6.4   BOOST_PARAMETER_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)

Defined in: boost/parameter/preprocessor.hpp

Same as BOOST_PARAMETER_MEMBER_FUNCTION, except that the name of the forwarding member function overloads is operator().

Generated names in enclosing scope:
 
  • boost_param_result_ ## __LINE__ ## operator
  • boost_param_params_ ## __LINE__ ## operator
  • boost_param_parameters_ ## __LINE__ ## operator
  • boost_param_impl ## operator
  • boost_param_dispatch_0boost_ ## __LINE__ ## operator
  • boost_param_dispatch_1boost_ ## __LINE__ ## operator

The test/preprocessor.cpp test program demonstrates proper usage of this macro.

6.5   BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)

Defined in: boost/parameter/preprocessor.hpp

Same as BOOST_PARAMETER_FUNCTION_CALL_OPERATOR, except that the overloaded function call operators and their helper methods are const-qualified.

The test/preprocessor.cpp and test/preprocessor_eval_cat_8.cpp test programs demonstrate proper usage of this macro.

6.6   BOOST_PARAMETER_CONSTRUCTOR(cls, impl, tag_namespace, arguments)

Defined in: boost/parameter/preprocessor.hpp
Requires:
 

cls is the name of this class. impl is the parenthesized implementation base class for cls. tag_namespace is the namespace in which the keywords used by the function resides. arguments is a list of argument-specifiers, as defined in BOOST_PARAMETER_FUNCTION except that optional-specifier no longer includes default-value. It is up to the delegate constructor in impl to determine the default value of all optional arguments.

Generated names in enclosing scope:
 
  • boost_param_params_ ## __LINE__ ## ctor
  • constructor_parameters ## __LINE__
Approximate expansion:

Where:

  • n denotes the minimum arity, as determined from arguments.
  • m denotes the maximum arity, as determined from arguments.

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

struct boost_param_params_ ## __LINE__ ## ctor
  : boost::parameter::parameters<
        list of parameter specifications, based on arguments
    >
{
};

typedef boost_param_params_ ## __LINE__ ## name
    constructor_parameters ## __LINE__;

template <typename A0, …, typename A ## n>
cls(A0&& a0, …, A ## n && a ## n)
  : impl(
        constructor_parameters ## __LINE__(
            std::forward<A0>(a0)
          , …
          , std::forward<A ## n>(a ## n)
        )
    )
{
}



template <typename A0, …, typename A ## m>
cls(A0&& a0, …, A ## m&& a ## m)
  : impl(
        constructor_parameters ## __LINE__(
            std::forward<A0>(a0)
          , …
          , std::forward<A ## m>(a ## m)
        )
    )
{
}

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is not #defined, then:

struct boost_param_params_ ## __LINE__ ## ctor
  : boost::parameter::parameters<
        list of parameter specifications, based on arguments
    >
{
};

typedef boost_param_params_ ## __LINE__ ## name
    constructor_parameters ## __LINE__;

template <typename A0, …, typename A ## n>
cls(A0 const& a0, …, A ## n const& a ## n)
  : impl(constructor_parameters ## __LINE__(a0, …, a ## n))
{
}

… exponential number of overloads …


template <typename A0, …, typename A ## n>
cls(A0& a0, …, A ## n & a ## n)
  : impl(constructor_parameters ## __LINE__(a0, …, a ## n))
{
}



template <typename A0, …, typename A ## m>
cls(A0 const& a0, …, A ## m const& a ## m)
  : impl(constructor_parameters ## __LINE__(a0, …, a ## m))
{
}

… exponential number of overloads …


template <typename A0, …, typename A ## m>
cls(A0& a0, …, A ## m & a ## m)
  : impl(constructor_parameters ## __LINE__(a0, …, a ## m))
{
}

The test/preprocessor.cpp and test/preprocessor_eval_category.cpp test programs demonstrate proper usage of this macro.

6.7   BOOST_PARAMETER_BASIC_FUNCTION(result, name, tag_namespace, arguments)

Defined in: boost/parameter/preprocessor.hpp

Same as BOOST_PARAMETER_FUNCTION, except:

  • For the argument specifiers syntax, optional-specifier no longer includes default-value. It is up to the function body to determine the default value of all optional arguments.
  • Generated names in the enclosing scope no longer include boost_param_dispatch_0boost_ ## __LINE__ ## name or boost_param_dispatch_1boost_ ## __LINE__ ## name.
  • Expansion of this macro omits all overloads of boost_param_dispatch_0boost_ ## __LINE__ ## name and boost_param_dispatch_1boost_ ## __LINE__ ## name and stops at the header of boost_param_impl ## name. Therefore, only the ArgumentPack type Args and its object instance args are available for use within the function body.

The test/preprocessor.cpp test program demonstrates proper usage of this macro.

6.8   BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, tag_namespace, arguments)

Defined in: boost/parameter/preprocessor.hpp

Same as BOOST_PARAMETER_BASIC_FUNCTION, except that:

  • name may be qualified by the static keyword to declare the member function and its helpers as not associated with any object of the enclosing type.
  • Expansion of this macro omits the forward declaration of the implementation function.

The test/preprocessor.cpp test program demonstrates proper usage of this macro.

6.9   BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(result, name, tag_namespace, arguments)

Defined in: boost/parameter/preprocessor.hpp

Same as BOOST_PARAMETER_BASIC_MEMBER_FUNCTION, except that the overloaded forwarding member functions and their helper methods are const-qualified.

The test/preprocessor.cpp test program demonstrates proper usage of this macro.

6.10   BOOST_PARAMETER_NAME(name)

Defined in: boost/parameter/name.hpp

Declares a tag-type and keyword object.

If name is of the form:

(object-name, namespace-name) qualifier(tag-name)

then

Requires:

qualifier is either in, out, in_out, consume, move_from, or forward.

Expands to:

namespace namespace-name {

    struct tag-name
    {
        static char const* keyword_name()
        {
            return ##tag-name;
        }

        typedef unspecified _;
        typedef unspecified _1;
        typedef boost::parameter::qualifier ## _reference qualifier;
    };
}

::boost::parameter::keyword<tag-namespace::tag-name> const&
    object-name = ::boost::parameter::keyword<
        tag-namespace::tag-name
    >::instance;

Else If name is of the form:

(object-name, namespace-name) tag-name

then

Treats name as if it were of the form:

(object-name, namespace-name) forward(tag-name)

Else If name is of the form:

qualifier(tag-name)

then

Requires:

qualifier is either in, out, in_out, consume, move_from, or forward.

Expands to:

namespace tag {

    struct tag-name
    {
        static char const* keyword_name()
        {
            return ##tag-name;
        }

        typedef unspecified _;
        typedef unspecified _1;
        typedef boost::parameter::qualifier ## _reference qualifier;
    };
}

::boost::parameter::keyword<tag::tag-name> const& _ ## tag-name
    = ::boost::parameter::keyword<tag::tag-name>::instance;

Else

Treats name as if it were of the form:

forward(tag-name)

6.11   BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)

Defined in: boost/parameter/nested_keyword.hpp

Declares a tag-type, a keyword object, and an alias for that object nested in the tag-type.

If name is of the form:

qualifier(tag-name)

then

Requires:

qualifier is either in, out, in_out, consume, move_from, or forward.

Expands to:

namespace tag {

    struct tag-name
    {
        static char const* keyword_name()
        {
            return ##tag-name;
        }

        typedef unspecified _;
        typedef unspecified _1;
        typedef boost::parameter::qualifier ## _reference qualifier;
        static ::boost::parameter::keyword<tag-name> const& alias;
    };

    ::boost::parameter::keyword<tag-name> const& tag-name::alias
        = ::boost::parameter::keyword<tag-name>::instance;
}

::boost::parameter::keyword<tag::tag-name> const& _ ## tag-name
    = ::boost::parameter::keyword<tag::tag-name>::instance;

Else

Treats name as if it were of the form:

forward(tag-name)

6.12   BOOST_PARAMETER_TEMPLATE_KEYWORD(name)

Defined in: boost/parameter/template_keyword.hpp
Included by: boost/parameter/name.hpp

Expands to:

namespace tag {

    struct name;
}

template <typename T>
struct name
  : ::boost::parameter::template_keyword<tag::name, T>
{
};

The test/function_type_tpl_param.cpp test program demonstrates proper usage of this macro.

6.13   BOOST_PARAMETER_FUN(r, n, l, h, p)

Deprecated

This macro has been deprecated in favor of BOOST_PARAMETER_FUNCTION.

Generates a sequence of forwarding function templates named n, with arities ranging from l to h, returning r, and using p to control overload resolution and assign tags to positional arguments.

Defined in: boost/parameter/macros.hpp
Requires: l and h are nonnegative integer tokens such that l < h

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

Expands to:
template <typename A1, typename A2, …, typename A ## l>
r
    name(
        A1&& a1, A2&& a2, …, A ## l && a ## l
      , typename p::match<A1, A2, …, A ## l>::type pk = p()
    )
{
    return name_with_named_params(
        pk(
            std::forward<A1>(a1)
          , std::forward<A2>(a2)
          , …
          , std::forward<A ## l>(a ## l)
        )
    );
}

template <
    typename A1
  , typename A2
  , …
  , typename A ## l
  , typename A ## BOOST_PP_INC(l)
>
r
    name(
        A1&& a1, A2&& a2, …, A ## l && a ## l
      , A ## BOOST_PP_INC(l) && a ## BOOST_PP_INC(l)
      , typename p::match<A1, A2, …, Al, A ## BOOST_PP_INC(l)>::type pk = p())
{
    return name_with_named_params(
        pk(
            std::forward<A1>(a1)
          , std::forward<A2>(a2)
          , …
          , std::forward<A ## l>(a ## l)
          , std::forward<A ## BOOST_PP_INC(l)>(a ## BOOST_PP_INC(l))
        )
    );
}



template <typename A1, typename A2, …, typename A ## h>
r
    name(
        A1&& a1, A2&& a2, …, A ## h && a ## h
      , typename p::match<A1, A2, …, A ## h>::type pk = p()
    )
{
    return name_with_named_params(
        pk(
            std::forward<A1>(a1)
          , std::forward<A2>(a2)
          , …
          , std::forward<A ## h>(a ## h)
        )
    );
}

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is not #defined, then:

Expands to:
template <typename A1, typename A2, …, typename A ## l>
r
    name(
        A1 const& a1, A2 const& a2, …, A ## l const& a ## l
      , typename p::match<A1, A2, …, A ## l>::type pk = p()
    )
{
    return name_with_named_params(pk(a1, a2, …, a ## l));
}

… exponential number of overloads …


template <typename A1, typename A2, …, typename A ## l>
r
    name(
        A1& a1, A2& a2, …, A ## l & a ## l
      , typename p::match<A1, A2, …, A ## l>::type pk = p()
    )
{
    return name_with_named_params(pk(a1, a2, …, a ## l));
}

template <
    typename A1
  , typename A2
  , …
  , typename A ## l
  , typename A ## BOOST_PP_INC(l)
>
r
    name(
        A1 const& a1, A2 const& a2, …, A ## l const& a ## l
      , A ## BOOST_PP_INC(l) const& a ## BOOST_PP_INC(l)
      , typename p::match<A1, A2, …, Al, A ## BOOST_PP_INC(l)>::type pk = p()
    )
{
    return name_with_named_params(
        pk(a1, a2, …, a ## l, a ## BOOST_PP_INC(l))
    );
}

… exponential number of overloads …


template <
    typename A1
  , typename A2
  , …
  , typename A ## l
  , typename A ## BOOST_PP_INC(l)
>
r
    name(
        A1& a1, A2& a2, …, A ## l & a ## l
      , A ## BOOST_PP_INC(l) & a ## BOOST_PP_INC(l)
      , typename p::match<A1, A2, …, Al, A ## BOOST_PP_INC(l)>::type pk = p()
    )
{
    return name_with_named_params(
        pk(a1, a2, …, a ## l, a ## BOOST_PP_INC(l))
    );
}



template <typename A1, typename A2, …, typename A ## h>
r
    name(
        A1 const& a1, A2 const& a2, …, A ## h const& a ## h
      , typename p::match<A1, A2, …, A ## h>::type pk = p()
    )
{
    return name_with_named_params(pk(a1, a2, …, a ## h));
}

… exponential number of overloads …


template <typename A1, typename A2, …, typename A ## h>
r
    name(
        A1& a1, A2& a2, …, A ## h& a ## h
      , typename p::match<A1, A2, …, A ## h>::type pk = p()
    )
{
    return name_with_named_params(pk(a1, a2, …, a ## h));
}

The test/macros.cpp and test/macros_eval_category.cpp test programs demonstrate proper usage of this macro.

6.14   BOOST_PARAMETER_KEYWORD(n, k)

Deprecated

This macro has been deprecated in favor of BOOST_PARAMETER_NAME.

Generates the declaration of a keyword tag type named k in namespace n, and a corresponding keyword object definition in the enclosing namespace.

Defined in: boost/parameter/keyword.hpp
Generates
namespace n {

    struct k
    {
        typedef boost::parameter::forward_reference qualifier;
    };
}

namespace {

    boost::parameter::keyword<tag-namespace::k>& k
        = boost::parameter::keyword<tag-namespace::k>::instance;
}

6.15   BOOST_PARAMETER_MATCH(p, a, x)

Generates a defaulted parameter declaration for a forwarding function.

Defined in: boost/parameter/match.hpp
Requires:

a is a Boost.Preprocessor sequence of the form

(A0)(A1)…(An)
Generates
    typename p::match<A0, A1, …, A ## n>::type
        x = p()

7   Configuration Macros

7.1   BOOST_PARAMETER_HAS_PERFECT_FORWARDING

Determines whether or not the library supports perfect forwarding, or the preservation of parameter value categories. Users can manually disable this macro by #defining the BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING macro. Otherwise, the library will #define this macro if and only if it and the configuration macros BOOST_NO_FUNCTION_TEMPLATE_ORDERING, BOOST_NO_SFINAE, BOOST_NO_CXX11_RVALUE_REFERENCES, and BOOST_NO_CXX11_VARIADIC_TEMPLATES are not already defined by Boost.Config.

Defined in: boost/parameter/config.hpp

7.2   BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING

It may be necessary to test user code in case perfect forwarding support is unavailable. Users can #define this macro either in their project settings or before including any library header files. Doing so will leave BOOST_PARAMETER_HAS_PERFECT_FORWARDING undefined.

7.3   BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then determines the MPL Variadic Sequence underlying the nested parameter_spec type of parameters. If the user does not manually #define this macro, then the library will #define it as ::boost::fusion::list if BOOST_FUSION_HAS_VARIADIC_LIST is defined (by Boost.Fusion), ::boost::fusion::deque if BOOST_FUSION_HAS_VARIADIC_DEQUE is defined (by Boost.Fusion), or ::boost::mpl::vector otherwise.

Example:
#define BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE ::boost::fusion::vector
Defined in: boost/parameter/parameters.hpp

7.4   BOOST_PARAMETER_MAX_ARITY

Determines the maximum number of arguments supported by the library.

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is #defined, then:

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is not #defined, then:

Defined in: boost/parameter/config.hpp
Default Value: BOOST_MPL_LIMIT_VECTOR_SIZE (defined by Boost.MPL) if perfect forwarding is supported, 8 otherwise.
Minimum Value: 2

7.5   BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY

If this library does not support perfect forwarding, determines the number of arguments less than which parameters generates an exponential number of function call operator overloads, and greater than or equal to which parameters does not. Will only be #defined by the library if it is not already #defined and BOOST_PARAMETER_HAS_PERFECT_FORWARDING is not #defined.

Defined in: boost/parameter/config.hpp
Default Value: 0
Minimum Value: 0

7.6   ...Outside Of This Library

  1. If Boost.Config defines the macro BOOST_NO_FUNCTION_TEMPLATE_ORDERING, then the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING will be left undefined; otherwise, the code generation macros would not work correctly.
  2. If Boost.Config defines the macro BOOST_NO_SFINAE, then the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING will be left undefined; otherwise, keyword types generated by BOOST_PARAMETER_NAME and BOOST_PARAMETER_NESTED_KEYWORD would not work correctly.
  3. If Boost.Config defines the macro BOOST_NO_CXX11_RVALUE_REFERENCES, then the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING will be left undefined.
  4. If Boost.Config defines the macro BOOST_NO_CXX11_VARIADIC_TEMPLATES, then the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING will be left undefined.
  5. If Boost.Fusion defines the macro BOOST_FUSION_HAS_VARIADIC_LIST, if this library defines the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING, and if the macro BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE is left undefined, then the MPL Variadic Sequence underlying the nested parameter_spec type of parameters will be ::boost::fusion::list.
  6. If Boost.Fusion defines the macro BOOST_FUSION_HAS_VARIADIC_DEQUE, if this library defines the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING, and if the macro BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE is left undefined, then the MPL Variadic Sequence underlying the nested parameter_spec type of parameters will be ::boost::fusion::deque.
  7. The value that Boost.MPL defines the macro BOOST_MPL_LIMIT_VECTOR_SIZE as will be the value that this library defines the macro BOOST_PARAMETER_MAX_ARITY as if this library defines the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING.

8   Tutorial

Follow this link to the Boost.Parameter tutorial documentation.


[1] References to tag objects may be initialized multiple times. This scenario can only occur in the presence of threading. Because the C++ standard doesn't consider threading, it doesn't explicitly allow or forbid multiple initialization of references. That said, it's hard to imagine an implementation where it could make a difference.
[2] (1, 2) Where BOOST_NO_RESULT_OF is #defined, boost::result_of<F()>::type is replaced by F::result_type.