From e80fba3fd9919dfbc1f0f7472c9f067987dc59a5 Mon Sep 17 00:00:00 2001 From: CromwellEnage <32967088+CromwellEnage@users.noreply.github.com> Date: Wed, 9 Oct 2019 05:39:39 -0400 Subject: [PATCH] Reinstate documentation with corrections --- doc/Jamfile.v2 | 30 + doc/html/index.html | 1773 ++++---- doc/html/reference.html | 8674 +++++++++++++-------------------------- doc/index.rst | 2923 +++++++++++++ doc/reference.rst | 7398 +++++++++++++++++++++++++++++++++ 5 files changed, 13815 insertions(+), 6983 deletions(-) create mode 100644 doc/Jamfile.v2 create mode 100644 doc/index.rst create mode 100644 doc/reference.rst diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 new file mode 100644 index 0000000..d920e33 --- /dev/null +++ b/doc/Jamfile.v2 @@ -0,0 +1,30 @@ +# 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) + +import docutils ; + +sources = [ glob *.rst ] ; +bases = $(sources:S=) ; + +# This is a path relative to the html/ subdirectory where the +# generated output will eventually be moved. +stylesheet = "--stylesheet=rst.css" ; + +for local b in $(bases) +{ + html $(b) : $(b).rst : + + # + "-gdt --link-stylesheet --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet) + ; +} + +alias htmls : $(bases) ; +stage html : $(bases) ; + +############################################################################### +alias boostdoc ; +explicit boostdoc ; +alias boostrelease : html ; +explicit boostrelease ; diff --git a/doc/html/index.html b/doc/html/index.html index a8e02c1..a8e1a3e 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -1,29 +1,27 @@ - - + + - - + The Boost Parameter Library +

The Boost Parameter Library

-

Boost

+ +

Boost


- - - + + +
Abstract: -

Use this library to write functions and class templates that -can accept arguments by name:

+
Abstract:Use this library to write functions and class templates that can +accept arguments by name:
 new_window(
     "alert"
@@ -37,23 +35,19 @@ smart_ptr<
   , copy_policy<DeepCopy>
 > p(new Foo);
 
-

Since named arguments can be passed in any order, they are -especially useful when a function or template has more than one parameter with -a useful default value. The library also supports deduced -parameters: that is to say, parameters whose identity can be deduced from -their types.

- - - - +

Since named arguments can be passed in any order, they are especially useful +when a function or template has more than one parameter with a useful default +value. The library also supports deduced parameters: that is to say, +parameters whose identity can be deduced from their types.

-

1.1   Named Function -Parameters

+

1.1   Named Function Parameters

-

This library addresses the problems outlined above -by associating each parameter name with a keyword object. Now users can -identify arguments by name, rather than by position:

+

This library addresses the problems outlined above by associating each +parameter name with a keyword object. Now users can identify arguments by +name, rather than by position:

 window* w = new_window(
     "alert box"
@@ -279,19 +222,16 @@ window* w = new_window(
 
 
-

1.2   Deduced Function -Parameters

+

1.2   Deduced Function Parameters

-

A deduced parameter can be passed -in any position without supplying an explicit parameter name. It's -not uncommon for a function to have parameters that can be uniquely identified -based on the types of arguments passed. The -name parameter to -new_window is one such example. None of the -other arguments, if valid, can reasonably be converted to a -char const*. With a deduced parameter -interface, we could pass the window name in any argument position -without causing ambiguity:

+

A deduced parameter can be passed in any position without supplying +an explicit parameter name. It's not uncommon for a function to have +parameters that can be uniquely identified based on the types of arguments +passed. The name parameter to new_window is one such +example. None of the other arguments, if valid, can reasonably be +converted to a char const*. With a deduced parameter interface, we +could pass the window name in any argument position without causing +ambiguity:

 window* w = new_window(
     movable_=false
@@ -302,34 +242,30 @@ window* w = new_window(
   , movable_=false
 ); // OK!
 
-

Appropriately used, a deduced parameter interface can -free the user of the burden of even remembering the formal parameter -names.

+

Appropriately used, a deduced parameter interface can free the user of the +burden of even remembering the formal parameter names.

-

1.3   Class Template -Parameter Support

+

1.3   Class Template Parameter Support

-

The reasoning we've given for named and deduced -parameter interfaces applies equally well to class templates as it does to -functions. Using the Parameter library, we can create interfaces that allow -template arguments (in this case shared and -Client) to be explicitly named, like -this:

+

The reasoning we've given for named and deduced parameter interfaces +applies equally well to class templates as it does to functions. Using +the Parameter library, we can create interfaces that allow template +arguments (in this case shared and Client) to be explicitly named, +like this:

 smart_ptr<
     ownership<shared>
   , value_type<Client>
 > p;
 
-

The syntax for passing named template arguments is -not quite as natural as it is for function arguments (ideally, we'd be able to -write smart_ptr<ownership = -shared, …>). This small syntactic -deficiency makes deduced parameters an especially big win when -used with class templates:

+

The syntax for passing named template arguments is not quite as natural as +it is for function arguments (ideally, we'd be able to write +smart_ptr<ownership = shared, …>). This small syntactic deficiency +makes deduced parameters an especially big win when used with class +templates:

 // p and q could be equivalent, given a deduced
 // parameter interface.
@@ -343,26 +279,22 @@ smart_ptr<Client, shared> q;
 

2   Tutorial

This tutorial shows all the basics—how to build both named- and -deduced-parameter interfaces to function templates and class templates—and -several more advanced idioms as well.

+deduced-parameter interfaces to function templates and class +templates—and several more advanced idioms as well.

-

2.1   Parameter-Enabled -Functions

-

In this section we'll show how the Parameter library can be used to build -an expressive interface to the Boost Graph library's -depth_first_search algorithm.1

+

2.1   Parameter-Enabled Functions

+

In this section we'll show how the Parameter library can be used to +build an expressive interface to the Boost Graph library's +depth_first_search algorithm.1

+refine the implementation with syntax improvements. Finally we'll show +how to streamline the implementation of named parameter interfaces, +improve their participation in overload resolution, and optimize their +runtime efficiency. -->

2.1.1   Headers And Namespaces

Most components of the Parameter library are declared in a header named for @@ -370,14 +302,11 @@ the component. For example,

 #include <boost/parameter/keyword.hpp>
 
-

will ensure boost::parameter::keyword is known to the -compiler. There is also a combined header, -boost/parameter.hpp, that includes most of -the library's components. For the the rest of this tutorial, unless we say -otherwise, you can use the rule above to figure out which header -to #include to access any given component of -the library.

+

will ensure boost::parameter::keyword is known to the compiler. There +is also a combined header, boost/parameter.hpp, that includes most of +the library's components. For the the rest of this tutorial, unless we +say otherwise, you can use the rule above to figure out which header to +#include to access any given component of the library.

@@ -387,18 +316,14 @@ using boost::parameter::keyword; namespace parameter = boost::parameter;
-

has been declared: we'll write parameter::xxx instead of -boost::parameter::xxx.

+

has been declared: we'll write parameter::xxx instead of +boost::parameter::xxx.

-

2.1.2   The Abstract Interface to -depth_first_search

-

The Graph library's depth_first_search -algorithm is a generic function accepting from one to four arguments by -reference. If all arguments were required, its signature might be as -follows:

+

2.1.2   The Abstract Interface to depth_first_search

+

The Graph library's depth_first_search algorithm is a generic function accepting +from one to four arguments by reference. If all arguments were +required, its signature might be as follows:

 template <
     typename Graph
@@ -410,73 +335,71 @@ void
     depth_first_search(
         Graph const& graph
       , DFSVisitor visitor
-      , typename graph_traits<Graph>::vertex_descriptor root_vertex
+      , typename graph_traits<g>::vertex_descriptor root_vertex
       , IndexMap index_map
       , ColorMap& color
     );
 
-

However, most of the parameters have a useful default value, as shown in -the table below.

+

However, most of the parameters have a useful default value, +as shown in the table below.

- - +----++++ - - + + - + - + - - + + - - + + - - + + - - - + + @@ -484,34 +407,32 @@ a std::vector of
depth_first_search -Parametersdepth_first_search Parameters
Parameter NameDataflow
Parameter +NameData +Flow TypeDefault Value (if any)Default Value +(if any)
graph inModel of Incidence -Graph and Vertex -List GraphModel of +Incidence Graph and +Vertex List Graph none - this argument is required.
visitor inModel of DFS -Visitorboost::dfs_visitor<>()Model of DFS Visitorboost::dfs_visitor<>()
root_vertex ingraph's vertex descriptor type.*vertices(graph).firstgraph's vertex +descriptor type.*vertices(graph).first
index_map inModel of Readable Property Map with key type := -graph's vertex descriptor and value type an -integer type.get(boost::vertex_index, -graph)Model of +Readable Property Map +with key type := +graph's vertex +descriptor and value +type an integer type.get(boost::vertex_index,graph)
color_mapin / outModel of Read/Write Property Map with key type := -graph's vertex descriptor type.an iterator_property_map created from -a std::vector of +in / +outModel of +Read/Write Property Map +with key type := +graph's vertex +descriptor type.a boost::iterator_property_map +created from a std::vector of default_color_type of size num_vertices(graph) and using index_map for the index map.

Don't be intimidated by the information in the second and third columns -above. For the purposes of this exercise, you don't need to understand them -in detail.

+above. For the purposes of this exercise, you don't need to understand +them in detail.

2.1.3   Defining the Keywords

The point of this exercise is to make it possible to call -depth_first_search with named arguments, -leaving out any arguments for which the default is appropriate:

+depth_first_search with named arguments, leaving out any +arguments for which the default is appropriate:

 graphs::depth_first_search(g, color_map_=my_color_map);
 

To make that syntax legal, there needs to be an object called -“color_map_” whose assignment operator can -accept a my_color_map argument. In this -step we'll create one such keyword object for each -parameter. Each keyword object will be identified by a unique -keyword tag type.

+“color_map_” whose assignment operator can accept a +my_color_map argument. In this step we'll create one such +keyword object for each parameter. Each keyword object will be +identified by a unique keyword tag type.

-

We're going to define our interface in namespace -graphs. The library provides a convenient -macro for defining keyword objects:

+ +We're going to define our interface in namespace ``graphs``. Since users +need access to the keyword objects, but not the tag types, we'll define +the keyword objects so they're accessible through ``graphs``, and we'll +hide the tag types away in a nested namespace, ``graphs::tag``. The +library provides a convenient macro for that purpose. --> +

We're going to define our interface in namespace graphs. The +library provides a convenient macro for defining keyword objects:

 #include <boost/parameter/name.hpp>
 
@@ -525,8 +446,7 @@ namespace graphs {
 }
 
-

The declaration of the graph keyword you -see here is equivalent to:

+

The declaration of the graph keyword you see here is equivalent to:

 namespace graphs {
     namespace tag {
@@ -541,29 +461,24 @@ namespace graphs {
     namespace // unnamed
     {
         // A reference to the keyword object
-        boost::parameter::keyword<tag::graph>& _graph
+        boost::parameter::keyword<tag::graph> const& _graph
             = boost::parameter::keyword<tag::graph>::instance;
     }
 }
 
-

It defines a keyword tag type named -tag::graph and a -keyword object reference named -_graph.

-

This “fancy dance” involving an unnamed namespace and references is all -done to avoid violating the One Definition Rule (ODR) -2 when the -named parameter interface is used by function templates that are instantiated -in multiple translation units (MSVC6.x users see this note).

+

It defines a keyword tag type named tag::graph and a keyword object +reference named _graph.

+

This “fancy dance” involving an unnamed namespace and references is all done +to avoid violating the One Definition Rule (ODR)2 when the named +parameter interface is used by function templates that are instantiated in +multiple translation units (MSVC6.x users see this note).

2.1.4   Writing the Function

Now that we have our keywords defined, the function template definition -follows a simple pattern using the -BOOST_PARAMETER_FUNCTION macro:

+follows a simple pattern using the BOOST_PARAMETER_FUNCTION macro:

 #include <boost/parameter/preprocessor.hpp>
 
@@ -572,11 +487,8 @@ namespace graphs {
     BOOST_PARAMETER_FUNCTION(
         (void),                 // 1. parenthesized return type
         depth_first_search,     // 2. name of the function template
-
         tag,                    // 3. namespace of tag types
-
         (required (graph, *) )  // 4. one required parameter, and
-
         (optional               //    four optional parameters,
                                 //    with defaults
             (visitor,     *, boost::dfs_visitor<>())
@@ -613,8 +525,7 @@ namespace boost {
 }
 ''') -->
 
-

The arguments to BOOST_PARAMETER_FUNCTION -are:

+

The arguments to BOOST_PARAMETER_FUNCTION are:

  1. The return type of the resulting function template. Parentheses around the return type prevent any commas it might contain from confusing the @@ -627,34 +538,26 @@ function's parameter names.

2.1.5   Function Signatures

-

Function signatures are described as one or two adjacent parenthesized -terms (a Boost.Preprocessor - -sequence) describing the function's parameters in the order in which -they'd be expected if passed positionally. Any required parameters must come -first, but the (required … ) clause can be -omitted when all the parameters are optional.

+

Function signatures are described as one or two adjacent parenthesized terms +(a Boost.Preprocessor sequence) describing the function's parameters in the +order in which they'd be expected if passed positionally. Any required +parameters must come first, but the (required … ) clause can be omitted +when all the parameters are optional.

2.1.5.1   Required Parameters

-

Required parameters are given first—nested in a -(required … ) clause—as a series of -two-element tuples describing each parameter name and any requirements on the -argument type. In this case there is only a single required parameter, so -there's just a single tuple:

+

Required parameters are given first—nested in a (required … ) +clause—as a series of two-element tuples describing each parameter name +and any requirements on the argument type. In this case there is only a +single required parameter, so there's just a single tuple:

 (required (graph, *) )
 
-

Since -depth_first_search doesn't require any -particular type for its graph parameter, we -use an asterix to indicate that any type is allowed. Required parameters must -always precede any optional parameters in a signature, but if there are -no required parameters, the -(required … ) clause can be omitted -entirely.

+

Since depth_first_search doesn't require any particular type for its +graph parameter, we use an asterix to indicate that any type is +allowed. Required parameters must always precede any optional parameters +in a signature, but if there are no required parameters, the +(required … ) clause can be omitted entirely.

-
-

2.1.5.3   Handling “In”, “Out”, “Consume / Move-From”, and -“Forward” Parameters

+
+

2.1.5.3   Handling “In”, “Out”, “Consume / Move-From”, and “Forward” Parameters

-

By default, Boost.Parameter treats all parameters as -if they were forward parameters, which functions would take in by rvalue reference and only -std::forward or -boost::forward to other functions. Such -parameters can be const lvalues, mutable -lvalues, const rvalues, or mutable -rvalues. Therefore, the default configuration grants the most flexibility to -user code. However:

-
    -
  • Users can configure one or more parameters to be in -parameters, which can fall into the same categories as forward -parameters but are now passed by const -lvalue reference and so must only be read from. Continuing from the previous -example, to indicate that root_vertex and -index_map are read-only, we wrap their names -in in(…).
  • +

    By default, Boost.Parameter treats all parameters as if they were +forward parameters, which functions would take in by rvalue reference +and only std::forward or boost::forward to other functions. Such +parameters can be const lvalues, mutable lvalues, const rvalues, +or mutable rvalues. Therefore, the default configuration grants the most +flexibility to user code. However:

    +
      +
    • Users can configure one or more parameters to be in parameters, +which can fall into the same categories as forward parameters but +are now passed by const lvalue reference and so must only be read +from. Continuing from the previous example, to indicate that +root_vertex and index_map are read-only, we wrap their names +in in(…).
    • Users can configure one or more parameters to be either out -parameters, which functions would strictly write to, or in-out -parameters, which functions would both read from and write to. Such -parameters can only be mutable lvalues. In the example, to indicate that -color_map is read-write, we wrap its name in -in_out(…). Note that Boost.Parameter sees -no functional difference between out(…) and -in_out(…), so you may choose whichever makes -your interfaces more self-documenting.
    • +parameters, which functions would strictly write to, or in-out +parameters, which functions would both read from and write +to. Such parameters can only be mutable lvalues. In the example, to +indicate that color_map is read-write, we wrap its name in +in_out(…). Note that Boost.Parameter sees no functional +difference between out(…) and in_out(…), so you may choose +whichever makes your interfaces more self-documenting.
    • Users can configure one or more parameters to be consume or -move-from parameters, which functions would take in by mutable rvalue reference and -std::move or -boost::move as the last access step. Such -parameters can only be mutable rvalues. Boost.Parameter supports wrapping the -corresponding names in consume(…) or -move_from(…).
    • +move-from parameters, which functions would take in by mutable +rvalue reference and std::move or boost::move as the last +access step. Such parameters can only be mutable +rvalues. Boost.Parameter supports wrapping the corresponding names in +consume(…) or move_from(…).
    -
    -    BOOST_PARAMETER_NAME(graph)
    -    BOOST_PARAMETER_NAME(visitor)
    -    BOOST_PARAMETER_NAME(in(root_vertex))
    -    BOOST_PARAMETER_NAME(in(index_map))
    -    BOOST_PARAMETER_NAME(in_out(color_map))
    +
    +BOOST_PARAMETER_NAME(graph)
    +BOOST_PARAMETER_NAME(visitor)
    +BOOST_PARAMETER_NAME(in(root_vertex))
    +BOOST_PARAMETER_NAME(in(index_map))
    +BOOST_PARAMETER_NAME(in_out(color_map))
     
    -

    In order to see what happens when parameters are bound to arguments that -violate their category constraints, attempt to compile the -test/compose.cpp test program with either the -LIBS_PARAMETER_TEST_COMPILE_FAILURE_0 macro -or the LIBS_PARAMETER_TEST_COMPILE_FAILURE_1 -macro #defined. You should encounter a -compiler error caused by a specific constraint violation.

    +

    In order to see what happens when parameters are bound to arguments that +violate their category constraints, attempt to compile the compose.cpp +test program with either the LIBS_PARAMETER_TEST_COMPILE_FAILURE_0 +macro or the LIBS_PARAMETER_TEST_COMPILE_FAILURE_1 macro +#defined. You should encounter a compiler error caused by a specific +constraint violation.

-

x will always be interpreted as a graph -and y will always be interpreted as a -visitor.

+

x will always be interpreted as a graph and y will always be +interpreted as a visitor.

2.1.5.5   Default Expression Evaluation

-

Note that in our example, the value of the graph -parameter is used in the default expressions for -root_vertex, -index_map, and -color_map.

-
+

Note that in our example, the value of the graph parameter is used in the +default expressions for root_vertex, index_map, and color_map.

+
 (required (graph, *) )
 (optional
-    (visitor,           *, boost::dfs_visitor<>())
-    (root_vertex,       *, *vertices(graph).first)
-    (index_map,         *, get(boost::vertex_index,graph))
-    (in_out(color_map), *,
+    (visitor,     *, boost::dfs_visitor<>())
+    (root_vertex, *, *vertices(graph).first)
+    (index_map,   *, get(boost::vertex_index, graph))
+    (color_map,   *,
         default_color_map(num_vertices(graph), index_map)
     )
 )
 
- -

A default expression is evaluated in the context of -all preceding parameters, so you can use any of their values by name.

+
-

A default expression is never evaluated—or even -instantiated—if an actual argument is passed for that parameter. We can -actually demonstrate that with our code so far by replacing the body of -depth_first_search with something that -prints the arguments:

+

A default expression is never evaluated—or even instantiated—if an actual +argument is passed for that parameter. We can actually demonstrate that +with our code so far by replacing the body of depth_first_search with +something that prints the arguments:

 #include <boost/graph/depth_first_search.hpp>  // for dfs_visitor
 
@@ -881,11 +759,10 @@ int main()
     return boost::report_errors();
 }
 
-

Despite the fact that default expressions such as vertices(graph).first -are ill-formed for the given graph -arguments, both calls will compile, and each one will print exactly the same -thing.

+

Despite the fact that default expressions such as +vertices(graph).first are ill-formed for the given graph +arguments, both calls will compile, and each one will print exactly the +same thing.

- +, (required + (graph, \*) + (visitor, \*) + (root_vertex, \*) + (index_map, \*) + (color_map, \*) + ) + ''') --> +

2.1.5.6   Signature Matching and Overloading

In fact, the function signature is so general that any call to -depth_first_search with fewer than five -arguments will match our function, provided we pass something for the -required graph parameter. That might not -seem to be a problem at first; after all, if the arguments don't match the -requirements imposed by the implementation of -depth_first_search, a compilation error -will occur later, when its body is instantiated.

-

There are at least three problems with very general function -signatures.

+depth_first_search with fewer than five arguments will match our function, +provided we pass something for the required graph parameter. That might +not seem to be a problem at first; after all, if the arguments don't match the +requirements imposed by the implementation of depth_first_search, a +compilation error will occur later, when its body is instantiated.

+

There are at least three problems with very general function signatures.

    -
  1. By the time our depth_first_search is -instantiated, it has been selected as the best matching overload. Some other -depth_first_search overload might've worked -had it been chosen instead. By the time we see a compilation error, there's -no chance to change that decision.
  2. +
  3. By the time our depth_first_search is instantiated, it has been +selected as the best matching overload. Some other depth_first_search +overload might've worked had it been chosen instead. By the time we see a +compilation error, there's no chance to change that decision.
  4. Even if there are no overloads, error messages generated at instantiation -time usually expose users to confusing implementation details. For example, -users might see references to names generated by +time usually expose users to confusing implementation details. For +example, users might see references to names generated by BOOST_PARAMETER_FUNCTION such as -graphs::detail::depth_first_search_with_named_params -(or worse—think of the kinds of errors you get from your STL -implementation when you make a mistake).4
  5. +graphs::detail::depth_first_search_with_named_params (or worse—think +of the kinds of errors you get from your STL implementation when you make +a mistake).4
  6. The problems with exposing such permissive function template signatures have been the subject of much discussion, especially in the presence of -unqualified calls. If all we want is to -avoid unintentional argument-dependent lookup (ADL), we can isolate -depth_first_search in a namespace containing -no types6, -but suppose we want it to found via ADL?
  7. +unqualified calls. If all we want is to avoid unintentional +argument-dependent lookup (ADL), we can isolate depth_first_search in +a namespace containing no types6, but suppose we want it to +found via ADL?

It's usually a good idea to prevent functions from being considered for overload resolution when the passed argument types aren't appropriate. The -library already does this when the required -graph parameter is not supplied, but we're -not likely to see a depth first search that doesn't take a graph to operate -on. Suppose, instead, that we found a different depth first search algorithm -that could work on graphs that don't model Incidence -Graph? If we just added a simple overload, it would be +library already does this when the required graph parameter is not +supplied, but we're not likely to see a depth first search that doesn't take a +graph to operate on. Suppose, instead, that we found a different depth first +search algorithm that could work on graphs that don't model +Incidence Graph? If we just added a simple overload, it would be ambiguous:

 // new overload
-BOOST_PARAMETER_FUNCTION(
-    (void), depth_first_search, (tag), (required (graph,*))( … )
+BOOST_PARAMETER_FUNCTION((void), depth_first_search, (tag),
+    (required (graph,*))( … )
 )
 {
     // new algorithm implementation
@@ -973,14 +839,11 @@ depth_first_search(boost::adjacency_list<>(), 2, "hello");
 
2.1.5.6.1   Predicate Requirements

We really don't want the compiler to consider the original version of -depth_first_search because the -root_vertex argument, -"hello", doesn't meet the -requirement that it -match the graph parameter's vertex +depth_first_search because the root_vertex argument, "hello", +doesn't meet the requirement that it match the graph parameter's vertex descriptor type. Instead, this call should just invoke our new overload. To -take the original depth_first_search -overload out of contention, we first encode this requirement as follows:

+take the original depth_first_search overload out of contention, we first +encode this requirement as follows:

 struct vertex_descriptor_predicate
 {
@@ -1003,42 +866,35 @@ struct vertex_descriptor_predicate
     };
 };
 
-

This encoding is an MPL -Binary Metafunction Class, a type with a nested -apply metafunction that takes in two -template arguments. For the first template argument, Boost.Parameter will -pass in the type on which we will impose the requirement. For the second -template argument, Boost.Parameter will pass in the entire argument pack, -making it possible to extract the type of each of the other -depth_first_search parameters via the -value_type metafunction and the -corresponding keyword tag type. The result type of the apply metafunction will be -equivalent to boost::mpl::true_ if -T fulfills our requirement as imposed by the -boost::is_convertible statement; otherwise, -the result will be equivalent to -boost::mpl::false_.

+

This encoding is an MPL Binary Metafunction Class, a type with a nested +apply metafunction that takes in two template arguments. For the first +template argument, Boost.Parameter will pass in the type on which we will +impose the requirement. For the second template argument, Boost.Parameter +will pass in the entire argument pack, making it possible to extract the +type of each of the other depth_first_search parameters via the +value_type metafunction and the corresponding keyword tag type. The +result type of the apply metafunction will be equivalent to +boost::mpl::true_ if T fulfills our requirement as imposed by the +boost::is_convertible statement; otherwise, the result will be +equivalent to boost::mpl::false_.

At this point, we can append the name of our metafunction class, in -parentheses, to the appropriate * element of -the function signature.

+parentheses, to the appropriate * element of the function signature.

 (root_vertex
-  , *(vertex_descriptor_predicate)
+  , *(vertex_descriptor_predicate)
   , *vertices(graph).first
 )
 
-

Now the original depth_first_search will -only be called when the root_vertex argument -can be converted to the graph's vertex descriptor type, and our example that -was ambiguous will smoothly call the new overload.

-

We can encode the requirements on other arguments using the same concept; -only the implementation of the nested apply -metafunction needs to be tweaked for each argument. There's no space to give -a complete description of graph library details here, but suffice it to show -that the next few metafunction classes provide the necessary checks.

+

Now the original depth_first_search will only be called when the +root_vertex argument can be converted to the graph's vertex descriptor +type, and our example that was ambiguous will smoothly call the new +overload.

+

We can encode the requirements on other arguments using the same concept; only +the implementation of the nested apply metafunction needs to be tweaked +for each argument. There's no space to give a complete description of graph +library details here, but suffice it to show that the next few metafunction +classes provide the necessary checks.

 struct graph_predicate
 {
@@ -1057,7 +913,6 @@ struct graph_predicate
               , boost::mpl::true_
               , boost::mpl::false_
             >
-          , boost::mpl::false_
         >
     {
     };
@@ -1110,9 +965,9 @@ struct color_map_predicate
     };
 };
 
-

Likewise, computing the default value for the color_map parameter is no trivial matter, so it's best to factor the -computation out to a separate function template.

+

Likewise, computing the default value for the color_map parameter is no +trivial matter, so it's best to factor the computation out to a separate +function template.

 template <typename Size, typename IndexMap>
 boost::iterator_property_map<
@@ -1133,31 +988,31 @@ boost::iterator_property_map<
     return m;
 }
 
-

The signature encloses each predicate metafunction in parentheses -preceded by an asterix, as follows:

+

The signature encloses each predicate metafunction in parentheses preceded +by an asterix, as follows:

 BOOST_PARAMETER_FUNCTION((void), depth_first_search, graphs,
-    (required
-        (graph, *(graph_predicate))
+(required
+    (graph, *(graph_predicate))
+)
+(optional
+    (visitor
+      , *  // not easily checkable
+      , boost::dfs_visitor<>()
     )
-    (optional
-        (visitor
-          , *  // not easily checkable
-          , boost::dfs_visitor<>()
-        )
-        (root_vertex
-          , *(vertex_descriptor_predicate)
-          , *vertices(graph).first
-        )
-        (index_map
-          , *(index_map_predicate)
-          , get(boost::vertex_index, graph)
-        )
-        (color_map
-          , *(color_map_predicate)
-          , default_color_map(num_vertices(graph), index_map)
-        )
+    (root_vertex
+      , (vertex_descriptor_predicate)
+      , *vertices(graph).first
     )
+    (index_map
+      , *(index_map_predicate)
+      , get(boost::vertex_index, graph)
+    )
+    (color_map
+      , *(color_map_predicate)
+      , default_color_map(num_vertices(graph), index_map)
+    )
+)
 )
 
-

The goal this time is to be able to invoke the new_window function without specifying the keywords. For each parameter -that has a required type, we can enclose that type in parentheses, then -replace the * element of the +

The goal this time is to be able to invoke the new_window function without +specifying the keywords. For each parameter that has a required type, we can +enclose that type in parentheses, then replace the * element of the parameter signature:

 BOOST_PARAMETER_NAME((name_, keywords) name)
@@ -1242,8 +1094,8 @@ BOOST_PARAMETER_NAME((movable_, keywords) movable)
 BOOST_PARAMETER_FUNCTION((window*), new_window, keywords,
     (deduced
         (required
-            (name, (char const*))
-            (movable, (bool))
+            (name, (char const*))
+            (movable, (bool))
         )
     )
 )
@@ -1255,49 +1107,44 @@ BOOST_PARAMETER_FUNCTION((window*), new_window, keywords,
 

The following statements will now work and are equivalent to each other as well as the previous statements:

-window* w = new_window(false, "alert box");
-window* w = new_window("alert box", false);
+window* w = new_window(false, "alert box");
+window* w = new_window("alert box", false);
 

2.1.5.7   Deduced Parameters

-

To further illustrate deduced parameter support, consider the example of -the def function from Boost.Python. Its signature is roughly as follows:

+

To further illustrate deduced parameter support, consider the example of the +def function from Boost.Python. Its signature is roughly as follows:

 template <
     typename Function
   , typename KeywordExpression
   , typename CallPolicies
 >
-void
-    def(
-        // Required parameters
-        char const* name, Function func
+void def(
+    // Required parameters
+    char const* name, Function func
 
-        // Optional, deduced parameters
-      , char const* docstring = ""
-      , KeywordExpression keywords = no_keywords()
-      , CallPolicies policies = default_call_policies()
-    );
+    // Optional, deduced parameters
+  , char const* docstring = ""
+  , KeywordExpression keywords = no_keywords()
+  , CallPolicies policies = default_call_policies()
+);
 
-

Try not to be too distracted by the use of the term “keywords” in -this example: although it means something analogous in Boost.Python -to what it means in the Parameter library, for the purposes of this -exercise you can think of it as being completely different.

-

When calling def, only two arguments are -required. The association between any additional arguments and their -parameters can be determined by the types of the arguments actually passed, so -the caller is neither required to remember argument positions or explicitly -specify parameter names for those arguments. To generate this interface using -BOOST_PARAMETER_FUNCTION, we need only -enclose the deduced parameters in a -(deduced …) clause, as follows:

+

Try not to be too distracted by the use of the term “keywords” in this +example: although it means something analogous in Boost.Python to what +it means in the Parameter library, for the purposes of this exercise +you can think of it as being completely different.

+

When calling def, only two arguments are required. The association +between any additional arguments and their parameters can be determined by the +types of the arguments actually passed, so the caller is neither required to +remember argument positions or explicitly specify parameter names for those +arguments. To generate this interface using BOOST_PARAMETER_FUNCTION, we +need only enclose the deduced parameters in a (deduced …) clause, as +follows:

 char const*& blank_char_ptr()
 {
@@ -1312,11 +1159,10 @@ BOOST_PARAMETER_FUNCTION(
 
     (deduced
         (optional
-            (docstring, (char const*), blank_char_ptr())
+            (docstring, (char const*), "")
 
             (keywords
-                // see 5
+                // see5
               , *(is_keyword_expression<boost::mpl::_>)
               , no_keywords()
             )
@@ -1327,13 +1173,12 @@ href="#is-keyword-expression" id="id13">5
                         boost::is_convertible<boost::mpl::_,char const*>
                       , boost::mpl::false_
                       , boost::mpl::if_<
-                            // see 5
+                            // see5
                             is_keyword_expression<boost::mpl::_>
                           , boost::mpl::false_
                           , boost::mpl::true_
-                        >
-                    >
+                        >
+                    >
                 )
               , default_call_policies()
             )
@@ -1344,7 +1189,7 @@ href="#is-keyword-expression" id="id14">5
     
 }
 
- +

Syntax Note

-

A (deduced …) clause always -contains a (required …) and/or an -(optional …) subclause, and must follow any -(required …) or -(optional …) clauses indicating nondeduced -parameters at the outer level.

+

A (deduced …) clause always contains a (required …) and/or an +(optional …) subclause, and must follow any (required …) or +(optional …) clauses indicating nondeduced parameters at the outer +level.

With the declaration above, the following two calls are equivalent:

@@ -1418,10 +1262,9 @@ def(
 int main()
 {
 ''') -->
-

If the user wants to pass a policies -argument that was also, for some reason, convertible to -char const*, she can always specify the -parameter name explicitly, as follows:

+

If the user wants to pass a policies argument that was also, for some +reason, convertible to char const*, she can always specify the parameter +name explicitly, as follows:

 def(
     f_name
@@ -1432,27 +1275,23 @@ def(
 
-

The test/deduced.cpp and test/deduced_dependent_predicate.cpp test programs demonstrate -additional usage of deduced parameter support.

+

The deduced.cpp and deduced_dependent_predicate.cpp test programs +demonstrate additional usage of deduced parameter support.

2.1.5.8   Parameter-Dependent Return Types

-

For some algorithms, the return type depends on at least one of the -argument types. However, there is one gotcha to avoid when encoding this -return type while using BOOST_PARAMETER_FUNCTION or other code generation macros. As an -example, given the following definitions:

+

For some algorithms, the return type depends on at least one of the argument +types. However, there is one gotcha to avoid when encoding this return type +while using BOOST_PARAMETER_FUNCTION or other code generation macros. As +an example, given the following definitions:

 BOOST_PARAMETER_NAME(x)
 BOOST_PARAMETER_NAME(y)
 BOOST_PARAMETER_NAME(z)
 
-

Let our algorithm simply return one of its arguments. If we naïvely -implement its return type in terms of parameter::value_type:

+ +

Let our algorithm simply return one of its arguments. If we naïvely implement +its return type in terms of parameter::value_type:

 BOOST_PARAMETER_FUNCTION(
     (typename parameter::value_type<Args,tag::y>::type), return_y, tag,
@@ -1470,20 +1309,20 @@ BOOST_PARAMETER_FUNCTION(
     return y;
 }
 
-

Then using return_y in any manner other -than with positional arguments will result in a compiler error:

+ +

Then using return_y in any manner other than with positional arguments +will result in a compiler error:

 std::map<char const*,std::string> k2s;
-assert("foo" == return_y(2, k2s, "foo"));  // error!
+assert("foo" == return_y(2, k2s, "foo"));  // error!
 
-

The problem is that even though y is a -required parameter, BOOST_PARAMETER_FUNCTION -will generate certain overloads for which the argument pack type Args does not actually contain the keyword tag -type tag::y. The solution is to use SFINAE -to preclude generation of those overloads. Since parameter::value_type is a metafunction, our tool for the job is lazy_enable_if:

+ +

The problem is that even though y is a required parameter, +BOOST_PARAMETER_FUNCTION will generate certain overloads for which the +argument pack type Args does not actually contain the keyword tag type +tag::y. The solution is to use SFINAE to preclude generation of those +overloads. Since parameter::value_type is a metafunction, our tool for +the job is lazy_enable_if:

 BOOST_PARAMETER_FUNCTION(
     (
@@ -1510,20 +1349,17 @@ BOOST_PARAMETER_FUNCTION(
     return y;
 }
 
-

For a working demonstration, see test/preprocessor_deduced.cpp.

+ +

For a working demonstration, see preprocessor_deduced.cpp.

-

2.2   Parameter-Enabled -Member Functions

+

2.2   Parameter-Enabled Member Functions

The BOOST_PARAMETER_MEMBER_FUNCTION and -BOOST_PARAMETER_CONST_MEMBER_FUNCTION macros -accept exactly the same arguments as -BOOST_PARAMETER_FUNCTION, but are designed -to be used within the body of a class:

+BOOST_PARAMETER_CONST_MEMBER_FUNCTION macros accept exactly the same +arguments as BOOST_PARAMETER_FUNCTION, but are designed to be used within +the body of a class:

 BOOST_PARAMETER_NAME(arg1)
 BOOST_PARAMETER_NAME(arg2)
@@ -1555,9 +1391,9 @@ int main()
 using namespace boost::parameter;
 ''') -->
 
-

These macros don't directly allow a function's interface to be -separated from its implementation, but you can always forward -arguments on to a separate implementation function:

+

These macros don't directly allow a function's interface to be separated from +its implementation, but you can always forward arguments on to a separate +implementation function:

 struct callable2
 {
@@ -1582,8 +1418,8 @@ using namespace boost::parameter;
 
 

2.2.1   Static Member Functions

-

To expose a static member function, simply insert the keyword -“static” before the function name:

+

To expose a static member function, simply insert the keyword “static” +before the function name:

 BOOST_PARAMETER_NAME(arg1)
 
@@ -1614,17 +1450,14 @@ using namespace boost::parameter;
 
 
-
-

2.3   Parameter-Enabled -Function Call Operators

-

The -BOOST_PARAMETER_FUNCTION_CALL_OPERATOR and -BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR -macros accept the same arguments as the -BOOST_PARAMETER_MEMBER_FUNCTION and -BOOST_PARAMETER_CONST_MEMBER_FUNCTION -macros,except for the function name, because these macros allow instances of -the enclosing classes to be treated as function objects:

+
+

2.3   Parameter-Enabled Function Call Operators

+

The BOOST_PARAMETER_FUNCTION_CALL_OPERATOR and +BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR macros accept the same +arguments as the BOOST_PARAMETER_MEMBER_FUNCTION and +BOOST_PARAMETER_CONST_MEMBER_FUNCTION macros except for the function name, +because these macros allow instances of the enclosing classes to be treated as +function objects:

 BOOST_PARAMETER_NAME(first_arg)
 BOOST_PARAMETER_NAME(second_arg)
@@ -1658,24 +1491,19 @@ using namespace boost::parameter;
 
 
-

2.4   Parameter-Enabled -Constructors

+

2.4   Parameter-Enabled Constructors

The lack of a “delegating constructor” feature in C++ -(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf) limits -somewhat the quality of interface this library can provide for defining -parameter-enabled constructors. The usual workaround for a lack of -constructor delegation applies: one must factor the common logic into one or -more base classes.

+(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf) +limits somewhat the quality of interface this library can provide +for defining parameter-enabled constructors. The usual workaround +for a lack of constructor delegation applies: one must factor the +common logic into one or more base classes.

Let's build a parameter-enabled constructor that simply prints its -arguments. The first step is to write a base class whose constructor accepts -a single argument known as an ArgumentPack: a bundle of references to the actual arguments, -tagged with their keywords. The values of the actual arguments are extracted -from the ArgumentPack by indexing -it with keyword objects:

+arguments. The first step is to write a base class whose +constructor accepts a single argument known as an ArgumentPack: +a bundle of references to the actual arguments, tagged with their +keywords. The values of the actual arguments are extracted from +the ArgumentPack by indexing it with keyword objects:

 BOOST_PARAMETER_NAME(name)
 BOOST_PARAMETER_NAME(index)
@@ -1695,13 +1523,10 @@ struct myclass_impl
 #include 
 #include 
 ''') -->
-

Note that the bitwise or (“|”) operator -has a special meaning when applied to keyword objects that are passed to an -ArgumentPack's indexing operator: it is used to -indicate a default value. In this case if there is no -index parameter in the -ArgumentPack, -42 will be used instead.

+

Note that the bitwise or (“|”) operator has a special meaning when +applied to keyword objects that are passed to an ArgumentPack's indexing +operator: it is used to indicate a default value. In this case if there is no +index parameter in the ArgumentPack, 42 will be used instead.

Now we are ready to write the parameter-enabled constructor interface:

 struct myclass : myclass_impl
@@ -1712,11 +1537,8 @@ struct myclass : myclass_impl
     ) // no semicolon
 };
 
-

Since we have supplied a default value for -index but not for -name, only -name is required. We can exercise our new -interface as follows:

+

Since we have supplied a default value for index but not for name, +only name is required. We can exercise our new interface as follows:

 myclass x("bob", 3);                      // positional
 myclass y(_index = 12, _name = "sally");  // named
@@ -1728,18 +1550,11 @@ myclass z("june");                        // positional/defaulted
 int main() {
 ''', ' return boost::report_errors(); }') -->
 
-

For more on ArgumentPack manipulation, see the -Advanced Topics -section.

+

For more on ArgumentPack manipulation, see the Advanced Topics section.

-

2.5   Parameter-Enabled -Class Templates

-

In this section we'll use Boost.Parameter to build -Boost.Python's class_ template, whose “signature” is:

+

2.5   Parameter-Enabled Class Templates

+

In this section we'll use Boost.Parameter to build Boost.Python's class_ template, whose “signature” is:

 template <
     ValueType, BaseList = bases<>
@@ -1748,8 +1563,7 @@ template <
 class class_;
 
-

Only the first argument, ValueType, is -required.

+

Only the first argument, ValueType, is required.

2.5.1   Named Template Parameters

First, we'll build an interface that allows users to pass arguments @@ -1791,8 +1605,7 @@ namespace boost { namespace python { -

The declaration of the class_type keyword -you see here is equivalent to:

+

The declaration of the class_type keyword you see here is equivalent to:

 namespace boost { namespace python {
     namespace tag {
@@ -1809,19 +1622,17 @@ namespace boost { namespace python {
 
-

It defines a keyword tag type named tag::class_type and a parameter passing -template named class_type.

+

It defines a keyword tag type named tag::class_type and a +parameter passing template named class_type.

2.5.1.2   Class Template Skeleton

-

The next step is to define the skeleton of our class template, which has -three optional parameters. Because the user may pass arguments in any order, -we don't know the actual identities of these parameters, so it would be -premature to use descriptive names or write out the actual default values for -any of them. Instead, we'll give them generic names and use the special type -boost::parameter::void_ as a default:

+

The next step is to define the skeleton of our class template, which has three +optional parameters. Because the user may pass arguments in any order, we +don't know the actual identities of these parameters, so it would be premature +to use descriptive names or write out the actual default values for any of +them. Instead, we'll give them generic names and use the special type +boost::parameter::void_ as a default:

 namespace boost { namespace python {
 
@@ -1843,14 +1654,10 @@ namespace boost { namespace python {
 

2.5.1.3   Class Template Signatures

-

Next, we need to build a type, known as a ParameterSpec, describing the “signature” of boost::python::class_. A -ParameterSpec enumerates the required and -optional parameters in their positional order, along with any type -requirements (note that it does not specify defaults -- those will be +

Next, we need to build a type, known as a ParameterSpec, describing the +“signature” of boost::python::class_. A ParameterSpec enumerates the +required and optional parameters in their positional order, along with any +type requirements (note that it does not specify defaults -- those will be dealt with separately):

 namespace boost { namespace python {
@@ -1889,19 +1696,14 @@ namespace boost { namespace python {
 ''') -->
 
-

2.5.1.4   Argument Packs -and Parameter Extraction

-

Next, within the body of class_, we use -the ParameterSpec's nested -::bind< … > template to bundle the -actual arguments into an ArgumentPack type, and then use the library's -value_type< … > metafunction to -extract “logical parameters”. value_type< … -> is a lot like binding< … >, -but no reference is added to the actual argument type. Note that defaults are -specified by passing it an optional third argument:

+

2.5.1.4   Argument Packs and Parameter Extraction

+

Next, within the body of class_ , we use the ParameterSpec's +nested ::bind< … > template to bundle the actual arguments into an +ArgumentPack type, and then use the library's value_type< … > +metafunction to extract “logical parameters”. value_type< … > is +a lot like binding< … >, but no reference is added to the actual +argument type. Note that defaults are specified by passing it an +optional third argument:

 namespace boost { namespace python {
 
@@ -1975,7 +1777,7 @@ BOOST_MPL_ASSERT((boost::is_same<c1::class_type, B>));
 BOOST_MPL_ASSERT((boost::is_same<c1::base_list, bases<> >));
 BOOST_MPL_ASSERT((boost::is_same<c1::held_type, B>));
 BOOST_MPL_ASSERT((
-     boost::is_same<c1::copyable, boost::noncopyable>
+    boost::is_same<c1::copyable, boost::noncopyable>
 ));
 
 BOOST_MPL_ASSERT((boost::is_same<c2::class_type, D>));
@@ -1991,19 +1793,13 @@ BOOST_MPL_ASSERT((boost::is_same<c2::copyable, void>));
 

2.5.3   Deduced Template Parameters

To apply a deduced parameter interface here, we need only make the type -requirements a bit tighter so the held_type -and copyable parameters can be crisply -distinguished from the others. Boost.Python does this by requiring -that base_list be a specialization of its -bases< … > template (as opposed to -being any old MPL sequence) and by requiring that -copyable, if explicitly supplied, be -boost::noncopyable. One easy way of -identifying specializations of bases< … -> is to derive them all from the same class, as an implementation -detail:

+requirements a bit tighter so the held_type and copyable parameters +can be crisply distinguished from the others. Boost.Python does this by +requiring that base_list be a specialization of its bases< … > +template (as opposed to being any old MPL sequence) and by requiring that +copyable, if explicitly supplied, be boost::noncopyable. One easy way +of identifying specializations of bases< … > is to derive them all from +the same class, as an implementation detail:

 namespace boost { namespace python {
     namespace detail {
@@ -2081,7 +1877,7 @@ namespace boost { namespace python {
     struct class_
     {
         // Create ArgumentPack
-        typedef typename class_signature::template bind<
+        typedef typename class_signature::bind<
             A0, A1, A2, A3
         >::type args;
 
@@ -2104,19 +1900,14 @@ namespace boost { namespace python {
     };
 }}
 ''') -->
-

It may seem like we've added a great deal of complexity, but the benefits -to our users are greater. Our original examples can now be written without +

It may seem like we've added a great deal of complexity, but the benefits to +our users are greater. Our original examples can now be written without explicit parameter names:

-typedef boost::python::class_<
-    B
-  , boost::noncopyable
-> c1;
+typedef boost::python::class_<B, boost::noncopyable> c1;
 
 typedef boost::python::class_<
-    D
-  , std::auto_ptr<D>
-  , bases<B>
+    D, std::auto_ptr<D>, bases<B>
 > c2;
 

Before you use this more verbose form, however, please read the section on -best practices for -keyword object naming.

+best practices for keyword object naming.

-

3.2   More -ArgumentPacks

-

We've already seen ArgumentPacks when we -looked at parameter-enabled constructors and class templates. As you might have guessed, -ArgumentPacks actually lie at the heart of -everything this library does; in this section we'll examine ways to build and -manipulate them more effectively.

+

3.2   More ArgumentPacks

+

We've already seen ArgumentPacks when we looked at +parameter-enabled constructors and class templates. As you +might have guessed, ArgumentPacks actually lie at the heart of +everything this library does; in this section we'll examine ways to +build and manipulate them more effectively.

-

3.2.1   Building -ArgumentPacks

-

The simplest ArgumentPack is the result of -assigning into a keyword object:

+

3.2.1   Building ArgumentPacks

+

The simplest ArgumentPack is the result of assigning into a keyword object:

 BOOST_PARAMETER_NAME(index)
 
@@ -2232,10 +2014,9 @@ int x = print_index(_index = 3);  // prints "index = 3"
 #include 
 #include 
 ''') -->
-

Also, ArgumentPacks can be composed using the -comma operator. The extra parentheses below are used to prevent the compiler -from seeing two separate arguments to -print_name_and_index:

+

Also, ArgumentPacks can be composed using the comma operator. The extra +parentheses below are used to prevent the compiler from seeing two separate +arguments to print_name_and_index:

 BOOST_PARAMETER_NAME(name)
 
@@ -2249,19 +2030,13 @@ int print_name_and_index(ArgumentPack const& args)
 
 int y = print_name_and_index((_index = 3, _name = "jones"));
 
-

The test/compose.cpp test program shows more examples of this feature.

-

To build an ArgumentPack with positional -arguments, we can use a ParameterSpec. As introduced described in the section on -Class Template -Signatures, a ParameterSpec describes the -positional order of parameters and any associated type requirements. Just as -we can build an ArgumentPack type with -its nested ::bind< … > template, we -can build an ArgumentPack object by -invoking its function call operator:

+

The compose.cpp test program shows more examples of this feature.

+

To build an ArgumentPack with positional arguments, we can use a +ParameterSpec. As introduced described in the section on Class Template +Signatures, a ParameterSpec describes the positional order of parameters +and any associated type requirements. Just as we can build an ArgumentPack +type with its nested ::bind< … > template, we can build an +ArgumentPack object by invoking its function call operator:

 parameter::parameters<
     required<tag::name, is_convertible<_,char const*> >
@@ -2272,11 +2047,11 @@ char const sam[] = "sam";
 int twelve = 12;
 
 int z0 = print_name_and_index(
-    spec(sam, twelve)
+    spec( sam, twelve )
 );
 
 int z1 = print_name_and_index(
-    spec(_index=12, _name="sam")
+    spec( _index=12, _name="sam" )
 );
 

Occasionally one needs to deduce argument types without an extra layer of function call. For example, suppose we wanted to return twice the value of -the index parameter? In that case we can -use the value_type< … > metafunction -introduced -earlier:

+the index parameter? In that case we can use the value_type< … > +metafunction introduced earlier:

 BOOST_PARAMETER_NAME(index)
 
@@ -2350,7 +2123,6 @@ typename boost::parameter::value_type<ArgumentPack,tag::index,int>::type
 {
     return 2 * args[_index | 42];
 }
-
 
-

Note that if we had used binding< … -> rather than value_type< … >, -we would end up returning a reference to the temporary created in the -2 * … expression.

+

Note that if we had used binding< … > rather than value_type< … >, we +would end up returning a reference to the temporary created in the 2 * … +expression.

3.2.3   Lazy Default Computation

-

When a default value is expensive to compute, it would be preferable to -avoid it until we're sure it's absolutely necessary. BOOST_PARAMETER_FUNCTION takes care of that -problem for us, but when using ArgumentPacks explicitly, we need a tool other than -operator|:

+

When a default value is expensive to compute, it would be preferable to avoid +it until we're sure it's absolutely necessary. BOOST_PARAMETER_FUNCTION +takes care of that problem for us, but when using ArgumentPacks +explicitly, we need a tool other than operator|:

 BOOST_PARAMETER_NAME(s1)
 BOOST_PARAMETER_NAME(s2)
@@ -2412,12 +2181,10 @@ int main()
 }
 ''') -->
 
-

In the example above, the string "hello, -world" is constructed despite the fact that the user passed us a -value for s3. To remedy that, we can +

In the example above, the string "hello, world" is constructed despite the +fact that the user passed us a value for s3. To remedy that, we can compute the default value lazily (that is, only on demand), by using -boost::bind() to -create a function object.

+boost::bind() to create a function object.

@@ -2425,7 +2192,7 @@ create a function object.

 typename parameter::binding<
-    ArgumentPack, tag::s3, std::string
+    ArgumentPack,tag::s3,std::string
 >::type s3 = args[
     _s3 || boost::bind(
         std::plus<std::string>(), boost::ref(s1), boost::ref(s2)
@@ -2466,20 +2233,15 @@ int main()
 
 
-

The expression bind(std::plus<std::string>(), ref(s1), ref(s2)) yields a -function object that, when invoked, adds the two strings -together. That function will only be invoked if no -s3 argument is supplied by the caller.

+

The expression bind(std::plus<std::string>(), ref(s1), ref(s2)) yields a +function object that, when invoked, adds the two strings together. That +function will only be invoked if no s3 argument is supplied by the caller.

@@ -2488,17 +2250,14 @@ together. That function will only be invoked if no
-

4   Best -Practices

+

4   Best Practices

By now you should have a fairly good idea of how to use the Parameter library. This section points out a few more-marginal issues that will help you use the library more effectively.

-

4.1   Keyword -Naming

-

BOOST_PARAMETER_NAME prepends a leading -underscore to the names of all our keyword objects in order to avoid the -following usually-silent bug:

+

4.1   Keyword Naming

+

BOOST_PARAMETER_NAME prepends a leading underscore to the names of all our +keyword objects in order to avoid the following usually-silent bug:

 namespace people
 {
@@ -2532,42 +2291,35 @@ namespace people
 
     void f(int age)
     {
-       .
-       .
-       .
-       g(age = 3);  // whoops!
+                .
+        .
+        .
+        
+        g(age = 3);  // whoops!
     }
 }
 
-

Although in the case above, the user was trying to pass the value -3 as the -age parameter to -g, what happened instead was that -f's age +

Although in the case above, the user was trying to pass the value 3 as the +age parameter to g, what happened instead was that f's age argument got reassigned the value 3, and was then passed as a positional -argument to g. Since -g's first positional parameter is -name, the default value for -age is used, and g prints -3:42. Our leading underscore naming -convention makes this problem less likely to occur.

-

In this particular case, the problem could have been detected if f's -age parameter had been made -const, which is always a good idea whenever +argument to g. Since g's first positional parameter is name, the +default value for age is used, and g prints 3:42. Our leading +underscore naming convention makes this problem less likely to occur.

+

In this particular case, the problem could have been detected if f's age +parameter had been made const, which is always a good idea whenever possible. Finally, we recommend that you use an enclosing namespace for all your code, but particularly for names with leading underscores. If we were to -leave out the people namespace above, names -in the global namespace beginning with leading underscores—which are reserved -to your C++ compiler—might become irretrievably ambiguous with those in our +leave out the people namespace above, names in the global namespace +beginning with leading underscores—which are reserved to your C++ +compiler—might become irretrievably ambiguous with those in our unnamed namespace.

-

4.2   Namespaces

-

In our examples we've always declared keyword objects in (an unnamed -namespace within) the same namespace as the Boost.Parameter-enabled functions -using those keywords:

+

4.2   Namespaces

+

In our examples we've always declared keyword objects in (an unnamed namespace +within) the same namespace as the Boost.Parameter-enabled functions using +those keywords:

 namespace lib {
 
@@ -2592,10 +2344,8 @@ namespace lib {
 
 
 

Users of these functions have a few choices:

-
    -
  1. Full qualification:
  2. -
-
+
    +
  1. Full qualification:

     int x = lib::f(
         lib::_name = "jill"
    @@ -2603,14 +2353,13 @@ int x = lib::f(
     );
     

    This approach is more verbose than many users would like.

    -
+ + -
    -
  1. Make keyword objects available through using-declarations:
  2. -
-
+
    +
  1. Make keyword objects available through using-declarations:

     using lib::_name;
     using lib::_index;
    @@ -2619,27 +2368,26 @@ int x = lib::f(_name = "jill", _index = 1);
     

    This version is much better at the actual call site, but the using-declarations themselves can be verbose and hard to manage.

    -
+ + -
    -
  1. Bring in the entire namespace with a using-directive:
  2. -
-
+
    +
  1. Bring in the entire namespace with a using-directive:

     using namespace lib;
     int x = f(_name = "jill", _index = 3);
     
    -

    This option is convenient, but it indiscriminately makes the -entire contents of lib available -without qualification.

    -
+

This option is convenient, but it indiscriminately makes the entire +contents of lib available without qualification.

+ + -

If we add an additional namespace around keyword declarations, -though, we can give users more control:

+

If we add an additional namespace around keyword declarations, though, we can +give users more control:

 namespace lib {
     namespace keywords {
@@ -2661,10 +2409,10 @@ namespace lib {
 
-

Now users need only a single using-directive to bring in just the -names of all keywords associated with -lib:

+#include +''') --> +

Now users need only a single using-directive to bring in just the names of +all keywords associated with lib:

 using namespace lib::keywords;
 int y = lib::f(_name = "bob", _index = 2);
@@ -2673,140 +2421,99 @@ int y = lib::f(_name = "bob", _index = 2);
 
 
-

4.3   Documentation

-

The interface idioms enabled by Boost.Parameter are completely new -(to C++), and as such are not served by pre-existing documentation -conventions.

+

4.3   Documentation

+

The interface idioms enabled by Boost.Parameter are completely new (to C++), +and as such are not served by pre-existing documentation conventions.

Note

-

This space is empty because we haven't settled on any best -practices yet. We'd be very pleased to link to your documentation if you've -got a style that you think is worth sharing.

+

This space is empty because we haven't settled on any best practices +yet. We'd be very pleased to link to your documentation if you've got a +style that you think is worth sharing.

-

5   Portability -Considerations

-

Use the regression -test results for the latest Boost release of the Parameter library to see -how it fares on your favorite compiler. Additionally, you may need to be -aware of the following issues and workarounds for particular compilers.

+

5   Portability Considerations

+

Use the regression test results for the latest Boost release of +the Parameter library to see how it fares on your favorite +compiler. Additionally, you may need to be aware of the following +issues and workarounds for particular compilers.

-

5.1   Perfect -Forwarding Support

-

If your compiler supports perfect forwarding, then the Parameter library will #define the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING -unless you disable it manually. If your compiler does not provide this -support, then parameter::parameters::operator() will treat rvalue references as lvalue -const references to work around the -forwarding problem, so in certain cases you must wrap -boost::ref or -std::ref around any arguments that will -be bound to out parameters. The test/evaluate_category.cpp and -test/preprocessor_eval_category.cpp test programs demonstrate this -support.

+

5.1   Perfect Forwarding Support

+

If your compiler supports perfect forwarding, then the Parameter library +will #define the macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING unless +you disable it manually. If your compiler does not provide this support, then +parameter::parameters::operator() will treat rvalue references as lvalue +const references to work around the forwarding problem, so in certain +cases you must wrap boost::ref or std::ref around any arguments that will +be bound to out parameters. The evaluate_category.cpp and +preprocessor_eval_category.cpp test programs demonstrate this support.

-

5.2   Boost.MP11 -Support

-

If your compiler is sufficiently compliant with the C++11 standard, then -the Parameter library will #define the macro -BOOST_PARAMETER_CAN_USE_MP11 unless you -disable it manually. The test/singular.cpp, test/compose.cpp, -test/optional_deduced_sfinae.cpp, and test/deduced_dependent_predicate.cpp test programs demonstrate support -for Boost.MP11.

+

5.2   Boost.MP11 Support

+

If your compiler is sufficiently compliant with the C++11 standard, then the +Parameter library will #define the macro BOOST_PARAMETER_CAN_USE_MP11 +unless you disable it manually. The singular.cpp, compose.cpp, +optional_deduced_sfinae.cpp, and deduced_dependent_predicate.cpp test programs +demonstrate support for Boost.MP11.

-

5.3   No SFINAE -Support

-

Some older compilers don't support SFINAE. If your compiler meets -that criterion, then Boost headers will -#define the preprocessor symbol -BOOST_NO_SFINAE, and parameter-enabled -functions won't be removed from the overload set based on their -signatures.

+

5.3   No SFINAE Support

+

Some older compilers don't support SFINAE. If your compiler meets that +criterion, then Boost headers will #define the preprocessor symbol +BOOST_NO_SFINAE, and parameter-enabled functions won't be removed +from the overload set based on their signatures. The sfinae.cpp and +optional_deduced_sfinae.cpp test programs demonstrate SFINAE support.

-

5.4   No Support -for result_of

-

Lazy default -computation relies on the result_of -class template to compute the types of default arguments given the type of the -function object that constructs them. On compilers that don't support -result_of, -BOOST_NO_RESULT_OF will be -#defined, and the compiler will expect the -function object to contain a nested type name, -result_type, that indicates its return type -when invoked without arguments. To use an ordinary function as a default -generator on those compilers, you'll need to wrap it in a class that provides -result_type as a -typedef and invokes the function via its -operator().

+

5.4   No Support for result_of

+

Lazy default computation relies on the result_of class template to +compute the types of default arguments given the type of the function object +that constructs them. On compilers that don't support result_of, +BOOST_NO_RESULT_OF will be #defined, and the compiler will expect +the function object to contain a nested type name, result_type, that +indicates its return type when invoked without arguments. To use an ordinary +function as a default generator on those compilers, you'll need to wrap it in +a class that provides result_type as a typedef and invokes the +function via its operator().

-

5.5   Compiler Can't -See References In Unnamed Namespace

+

5.5   Compiler Can't See References In Unnamed Namespace

If you use Microsoft Visual C++ 6.x, you may find that the compiler has trouble finding your keyword objects. This problem has been observed, but -only on this one compiler, and it disappeared as the test code evolved, so we -suggest you use it only as a last resort rather than as a preventative -measure. The solution is to add using-declarations to force the -names to be available in the enclosing namespace without qualification:

+only on this one compiler, and it disappeared as the test code evolved, so +we suggest you use it only as a last resort rather than as a preventative +measure. The solution is to add using-declarations to force the names +to be available in the enclosing namespace without qualification:

 namespace graphs {
 
@@ -2820,63 +2527,33 @@ namespace graphs {
 
-

6   Python -Binding

-

Follow this link for -documentation on how to expose Boost.Parameter-enabled functions to Python -with Boost.Python.

+

6   Python Binding

+

Follow this link for documentation on how to expose +Boost.Parameter-enabled functions to Python with Boost.Python.

7   Reference

-

Follow this link to -the Boost.Parameter reference documentation.

+

Follow this link to the Boost.Parameter reference documentation.

8   Glossary

- --- - - - - - - - - -
Argument (or “actual argument”):
  -

the value actually passed to a function or class template

-
- --- - - - - - - - - -
Parameter (or “formal parameter”):
  -

the name used to refer to an argument -within a function or class template. For example, the value of -f's parameter -x is given by the argument -3:

-
+
+

8.1   Argument (or “actual argument”)

+

the value actually passed to a function or class template.

+
+
+

8.2   Parameter (or “formal parameter”)

+

the name used to refer to an argument within a function or class +template. For example, the value of f's parameter x is given by the +argument 3:

+
 int f(int x) { return x + 1; }
 int y = f(3);
 
-
+
-

9   Acknowledgements

+

9   Acknowledgements

The authors would like to thank all the Boosters who participated in the review of this library and its documentation, most especially our review manager, Doug Gregor.

@@ -2884,69 +2561,55 @@ manager, Doug Gregor.

- +
[1]As of -Boost 1.33.0 the Graph library was still using an -older named parameter mechanism, but there are plans to change it to use -Boost.Parameter (this library) in an upcoming release, while keeping the old -interface available for backward-compatibility.
[1]As of Boost 1.33.0 the Graph library was still using an +older named parameter mechanism, but there are plans to change it to +use Boost.Parameter (this library) in an upcoming release, while keeping +the old interface available for backward-compatibility.
- +
[2]The -One Definition Rule says that any given entity in a C++ -program must have the same definition in all translation units (object files) -that make up a program.
[2]The One Definition Rule says that any given entity in a C++ +program must have the same definition in all translation units (object +files) that make up a program.
- +
- +
[3]If you're not familiar with the Boost Graph -Library, don't worry about the meaning of any Graph-library-specific details -you encounter. In this case you could replace all mentions of vertex -descriptor types with int in the text, and -your understanding of the Parameter library wouldn't suffer.
[3]If you're not familiar with the Boost Graph Library, +don't worry about the meaning of any Graph-library-specific details you +encounter. In this case you could replace all mentions of vertex +descriptor types with int in the text, and your understanding of the +Parameter library wouldn't suffer.
- +
- +
[4]This -is a major motivation behind C++20 constraints.
[4]This is a major motivation behind C++20 constraints.
- - - + + +
- - - - +
[5](1, 2) Here we're assuming there's a predicate metafunction -is_keyword_expression that can be used to -identify models of Boost.Python's KeywordExpression concept.
[5](1, 2) Here we're assuming there's a predicate +metafunction is_keyword_expression that can be used to identify +models of Boost.Python's KeywordExpression concept.
- - - @@ -2963,38 +2626,28 @@ to Herb Sutter.

[6]

You can always give the illusion that the function lives -in an outer namespace by applying a using-declaration:

-
+
[6]

You can always give the illusion that the function +lives in an outer namespace by applying a using-declaration:

+
 namespace foo_overloads {
 
     // foo declarations here
@@ -2955,7 +2618,7 @@ namespace foo_overloads {
 }
 using foo_overloads::foo;
 
-

This technique for avoiding unintentional argument-dependent lookup is due +

This technique for avoiding unintentional argument-dependent lookup is due to Herb Sutter.

- - - - +
[7]This capability depends on your compiler's support for -SFINAE. SFINAE: Substitution -Failure Is Not -An Error. If type substitution during the -instantiation of a function template results in an invalid type, no -compilation error is emitted; instead the overload is removed from the -overload set. By producing an invalid type in the function signature -depending on the result of some condition, we can decide whether or not an -overload is considered during overload resolution. The technique is -formalized in the enable_if utility. Most recent compilers support SFINAE; on -compilers that don't support it, the Boost config library will -#define the symbol -BOOST_NO_SFINAE. See -http://www.semantics.org/once_weakly/w02_SFINAE.pdf for more information -on SFINAE.
[7]This capability depends on your compiler's support for +SFINAE. SFINAE: Substitution Failure Is Not +An Error. If type substitution during the instantiation of a +function template results in an invalid type, no compilation error is +emitted; instead the overload is removed from the overload set. By +producing an invalid type in the function signature depending on the +result of some condition, we can decide whether or not an overload is +considered during overload resolution. The technique is formalized in the +enable_if utility. Most recent compilers support SFINAE; on compilers +that don't support it, the Boost config library will #define the +symbol BOOST_NO_SFINAE. See +http://www.semantics.org/once_weakly/w02_SFINAE.pdf for more information +on SFINAE.
diff --git a/doc/html/reference.html b/doc/html/reference.html index 66a3aff..05778b4 100644 --- a/doc/html/reference.html +++ b/doc/html/reference.html @@ -1,325 +1,154 @@ - + - + The Boost Parameter Library Reference Documentation - + -
+

The Boost Parameter Library Reference Documentation

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

+

Boost


Contents


-

1   Preliminaries

+

1   Preliminaries

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

+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.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.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.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.

+

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

+

2   Terminology

keyword
The name of a function parameter.
@@ -336,264 +165,193 @@ in the usual C++ way: by position with respect to a parameter list.
tag type
-
Shorthand for “keyword tag type.”
+
Shorthand for “keyword tag type.”
keyword object
-
An instance of keyword -<T> for some -tag type -T.
+
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.

+

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.
+
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.
+
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.
+
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.

+

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

+

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. If BOOST_PARAMETER_CAN_USE_MP11 is defined, then every ArgumentPack is also a valid Boost.MP11 map whose keys are keyword tag types. The test/singular.cpp, test/compose.cpp, and test/mpl.cpp test -programs demonstrate this functionality.

+

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. If BOOST_PARAMETER_CAN_USE_MP11 +is defined, then every ArgumentPack is also a valid Boost.MP11 map whose +keys are keyword tag types. The singular.cpp, compose.cpp, and +mpl.cpp test programs demonstrate this functionality.

Requirements

In the table below,

-

Any exceptions are thrown from the invocation of -w's value +

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

---+++ - - + - - - - + + - + - - - + + - + - + - + - + - +
ArgumentPack requirements
Expression
Expression Type Requirements Semantics/Notes
x[u]binding<A,K>::typex contains an element b whose -keyword is +
x[u]binding<A, K>::typex contains +an element b +whose keyword is KReturns b's value (by reference).Returns b's +value (by +reference).
x[u]binding<A,L,D>::type
x[u]binding<A, L, D>::type noneIf x contains an element b -whose keyword is the same as -u's, returns b's value (by -reference). Otherwise, returns u's -value.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>::typelazy_binding<A, M, E>::type noneIf 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.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, zModel of ArgumentPackModel of ArgumentPack noneReturns an ArgumentPack containing all the elements of both -x and -z.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,

+
+

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 satisfactionParameterSpec allowed forms and conditions of satisfaction
TypeA requiredCondition A must -satisfy
TypeA +requiredCondition A must satisfy
K
K no n/a
optional<K,F>
optional<K,F> nompl::apply2<F,A,P>::type::value -is true.mpl::apply2<F,A,P>::type::value is +true.
required<K,F>
required<K,F> yesmpl::apply2<F,A,P>::type::value -is true.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.

+

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.

+

4   Class Templates

+
+

4.1   keyword

+

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

- - +
Defined in:boost/parameter/keyword.hpp
Defined in:boost/parameter/keyword.hpp
@@ -603,438 +361,287 @@ struct keyword { typedef Tag tag; - constexpr keyword() - { - } - template <typename T> - constexpr typename boost::enable_if< - typename boost::mpl::eval_if< - boost::is_scalar<T> - , boost::mpl::true_ - , boost::mpl::eval_if< - boost::is_same< + constexpr typename boost::enable_if< + typename boost::mpl::eval_if< + boost::is_scalar<T> + , mpl::true_ // Enable this overload for scalar types. + , boost::mpl::eval_if< + boost::is_same< typename Tag::qualifier , boost::parameter::in_reference > - , boost::mpl::true_ - , boost::mpl::if_< - boost::is_same< + , mpl::true_ // Enable this overload for "in" references. + , mpl::if_< + boost::is_same< typename Tag::qualifier , boost::parameter::forward_reference > - , boost::mpl::true_ - , boost::mpl::false_ + , mpl::true_ // Enable this overload for "forward" references. + , mpl::false_ // Disable this overload for all other reference categories. > > >::type - , ArgumentPack + , ArgumentPack >::type - operator=(T const& value) const; + operator=(T const& value) const; template <typename T> - constexpr typename boost::enable_if< - typename boost::mpl::eval_if< - typename boost::mpl::eval_if< - boost::is_same< + constexpr 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< + , mpl::true_ // The reference category is "out". + , mpl::if_< + boost::is_same< typename Tag::qualifier , boost::parameter::forward_reference > - , boost::mpl::true_ - , boost::mpl::false_ + , mpl::true_ // The reference category is "forward". + , mpl::false_ // The reference category is neither "out" nor "forward". > + >::type + , mpl::if_< + boost::is_const<T> + , mpl::false_ // Disable this overload for reference-to-const types. + , mpl::true_ // Enable this overload for referece-to-mutable types. > - , boost::mpl::if_< - boost::is_const<T> - , boost::mpl::false_ - , boost::mpl::true_ - > - , boost::mpl::false_ + , mpl::false_ // Disable this overload for references neither "out" nor "forward". >::type - , ArgumentPack + , ArgumentPack >::type - operator=(T& value) const; + operator=(T& value) const; template <typename T> - constexpr typename boost::enable_if< - typename boost::mpl::eval_if< - boost::is_scalar<T> - , boost::mpl::false_ - , boost::mpl::eval_if< - boost::is_same< + constexpr typename boost::enable_if< + typename boost::mpl::eval_if< + boost::is_scalar<T> + , mpl::false_ // Disable this overload for scalar types. + , boost::mpl::eval_if< + boost::is_same< typename Tag::qualifier , boost::parameter::in_reference > - , boost::mpl::true_ - , boost::mpl::if_< - boost::is_same< + , mpl::true_ // Enable this overload for "in" references. + , mpl::if_< + boost::is_same< typename Tag::qualifier , boost::parameter::forward_reference > - , boost::mpl::true_ - , boost::mpl::false_ + , mpl::true_ // Enable this overload for "forward" references. + , mpl::false_ // Disable this overload for all other reference categories. > > >::type - , ArgumentPack + , ArgumentPack >::type - operator=(T const&& value) const; + operator=(T const&& value) const; template <typename T> - constexpr typename boost::enable_if< - typename boost::mpl::eval_if< - boost::is_scalar<T> - , boost::mpl::false_ - , boost::mpl::eval_if< - boost::is_same< + constexpr typename boost::enable_if< + typename boost::mpl::eval_if< + boost::is_scalar<T> + , mpl::false_ // Disable this overload for scalar types. + , boost::mpl::eval_if< + boost::is_same< typename Tag::qualifier , boost::parameter::consume_reference > - , boost::mpl::true_ - , boost::mpl::if_< - boost::is_same< + , mpl::true_ // Enable this overload for "consume" references. + , mpl::if_< + boost::is_same< typename Tag::qualifier , boost::parameter::forward_reference > - , boost::mpl::true_ - , boost::mpl::false_ + , mpl::true_ // Enable this overload for "forward" references. + , mpl::false_ // Disable this overload for all other reference categories. > > >::type - , ArgumentPack + , ArgumentPack >::type - operator=(T&& value) const; + operator=(T&& value) const; template <typename T> - constexpr typename boost::enable_if< - typename boost::mpl::eval_if< - boost::is_scalar<T> - , boost::mpl::true_ - , boost::mpl::eval_if< - boost::is_same< + constexpr typename boost::enable_if< + typename boost::mpl::eval_if< + boost::is_scalar<T> + , mpl::true_ // Enable this overload for scalar types. + , boost::mpl::eval_if< + boost::is_same< typename Tag::qualifier , boost::parameter::in_reference > - , boost::mpl::true_ - , boost::mpl::if_< - boost::is_same< + , mpl::true_ // Enable this overload for "in" references. + , mpl::if_< + boost::is_same< typename Tag::qualifier , boost::parameter::forward_reference > - , boost::mpl::true_ - , boost::mpl::false_ + , mpl::true_ // Enable this overload for "forward" references. + , mpl::false_ // Disable this overload for all other reference categories. > > >::type , tagged default >::type - operator|(T const& x) const; + operator|(T const& x) const; template <typename T> - constexpr typename boost::enable_if< - typename boost::mpl::eval_if< - typename boost::mpl::eval_if< - boost::is_same< + constexpr 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< + , mpl::true_ // The reference category is "out". + , mpl::if_< + boost::is_same< typename Tag::qualifier , boost::parameter::forward_reference > - , boost::mpl::true_ - , boost::mpl::false_ + , mpl::true_ // The reference category is "forward". + , mpl::false_ // The reference category is neither "out" nor "forward". > + >::type + , mpl::if_< + boost::is_const<T> + , mpl::false_ // Disable this overload for reference-to-const types. + , mpl::true_ // Enable this overload for referece-to-mutable types. > - , boost::mpl::if_< - boost::is_const<T> - , boost::mpl::false_ - , boost::mpl::true_ - > - , boost::mpl::false_ + , mpl::false_ // Disable this overload for references neither "out" nor "forward". >::type , tagged default >::type - operator|(T& x) const; + operator|(T& x) const; template <typename T> - constexpr typename boost::enable_if< - typename boost::mpl::eval_if< - boost::is_scalar<T> - , boost::mpl::false_ - , boost::mpl::eval_if< - boost::is_same< + constexpr typename boost::enable_if< + typename boost::mpl::eval_if< + boost::is_scalar<T> + , mpl::false_ // Disable this overload for scalar types. + , boost::mpl::eval_if< + boost::is_same< typename Tag::qualifier , boost::parameter::in_reference > - , boost::mpl::true_ - , boost::mpl::if_< - boost::is_same< + , mpl::true_ // Enable this overload for "in" references. + , mpl::if_< + boost::is_same< typename Tag::qualifier , boost::parameter::forward_reference > - , boost::mpl::true_ - , boost::mpl::false_ + , mpl::true_ // Enable this overload for "forward" references. + , mpl::false_ // Disable this overload for all other reference categories. > > >::type , tagged default >::type - operator|(T const&& x) const; + operator|(T const&& x) const; template <typename T> - constexpr typename boost::enable_if< - typename boost::mpl::eval_if< - boost::is_scalar<T> - , boost::mpl::false_ - , boost::mpl::eval_if< - boost::is_same< + constexpr typename boost::enable_if< + typename boost::mpl::eval_if< + boost::is_scalar<T> + , mpl::false_ // Disable this overload for scalar types. + , boost::mpl::eval_if< + boost::is_same< typename Tag::qualifier , boost::parameter::consume_reference > - , boost::mpl::true_ - , boost::mpl::if_< - boost::is_same< + , mpl::true_ // Enable this overload for "consume" references. + , mpl::if_< + boost::is_same< typename Tag::qualifier , boost::parameter::forward_reference > - , boost::mpl::true_ - , boost::mpl::false_ + , mpl::true_ // Enable this overload for "forward" references. + , mpl::false_ // Disable this overload for all other reference categories. > > >::type , tagged default - >::type - operator|(T&& x) const; + >::type constexpr + operator|(T&& value) const; template <typename F> - constexpr tagged lazy default operator||(F const&) const; + constexpr tagged lazy default operator||(F const&) const; template <typename F> - constexpr tagged lazy default operator||(F&) const; + constexpr tagged lazy default operator||(F&) const; - static keyword<Tag> const& instance; + static keyword<Tag> const& instance; - static keyword<Tag>& get(); + static keyword<Tag>& get(); }; -
-
operator=
-
-
-template <typename T>
-constexpr ArgumentPack operator=(T const& value) const;
-
-template <typename T>
-constexpr ArgumentPack operator=(T& value) const;
-
-template <typename T>
-constexpr ArgumentPack operator=(T const&& value) const;
-
-template <typename T>
-constexpr ArgumentPack operator=(T&& value) const;
-
- +

operator=

+
- - - - - - - +
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
Synopsis:
-
-
-
-
operator|
-
+
+template <typename T>
+constexpr ArgumentPack operator=(T const& value) const;
+
+template <typename T>
+constexpr ArgumentPack operator=(T& value) const;
+
+template <typename T>
+constexpr ArgumentPack operator=(T const&& value) const;
+
+template <typename T>
+constexpr 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|

+ +++ + + + +
Synopsis:
+
 template <typename T>
 constexpr tagged default operator|(T const& x) const;
 
@@ -1047,165 +654,128 @@ constexpr tagged default operator|(T const&& x) const;
 template <typename T>
 constexpr 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.
Requires:one of the following:
-
-
-
-
operator||
-
-
+
    +
  • 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||

+ +++ + + + +
Synopsis:
+
 template <typename F>
 constexpr tagged lazy default operator||(F const& g) const;
 
 template <typename F>
 constexpr 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 function 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
Requires:g() must be valid, with type +boost::result_of<F()>::type.2
Returns:a tagged lazy default with value g and keyword Tag.
+

instance

+ +++ +
Synopsis:
-template <typename Tag, typename T>
+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

+ +++ + + + +
Synopsis:
+
+static keyword<Tag>& get();
+
+
+

Deprecated

+

This function 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;
@@ -1213,28 +783,18 @@ struct template_keyword
     typedef implementation defined reference;
 };
 
-

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

+

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.

+
+

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
Defined in:boost/parameter/parameters.hpp
@@ -1243,202 +803,151 @@ template <typename ...PSpec> struct parameters { template <typename ...Args> - struct match + struct match { typedef … type; }; template <typename ...Args> - ArgumentPack operator()(Args&&... args) const; + ArgumentPack operator()(Args&&... args) const; }; - - - +
Requires:Each element in the PSpec parameter pack must be a model of ParameterSpec.
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
+

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=
+
if A ## i is a result type of keyword<T>:: operator=
then
-
K ## i is -T
+
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
+
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
+
if some parameter spec d ## j in D ## i
+
matches A ## i
then
-
K ## i is d ## j's keyword tag type.
-
Di+1 is -D ## i - -[d ## j]
+
K ## i is the keyword tag type of d ## j.
+
Di+1 is D ## i - [ d ## j]
else
-
K ## i is P ## i's keyword tag type.
+
K ## i is the keyword tag type of P ## i.
-
match
-
-

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

+
A Metafunction used to remove a forwarding function from overload +resolution.
+
- - - +
Returns:if all elements in -Params... are satisfied (see -below), then parameters<Params...>. Otherwise, -match<Args...>::type is not defined.
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 +

    Each element P in Params... is satisfied if 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
    • -
    +
  • P is the unspecified default

  • -
  • or, P is -required<X,F>, and -
      -
    • X is some K ## i, and
    • -
    • mpl::apply<F,R ## i>::type::value is -true
    • -
    +
  • 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

      +
      +
    -
    -
    operator()
    -
    -
    -template <typename ...Args>
    -ArgumentPack operator()(Args&&... args) const;
    -
    - + +
  • +
    or, P is required <X,F>, and
    +
      +
    • X is some K ## i, and
    • +
    • mpl::apply<F,R ## i >::type::value is true
    • +
    +
    +
    +
  • + +

    operator()

    +
    - - - + + +
    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
    • +
    Synopsis:
    +
    +template <typename ...Args>
    +ArgumentPack operator()(Args&&... args) 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

+

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

+

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

+

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

+

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

- - - - - - + +
Specializations model:
 ParameterSpec
Specializations model:
 ParameterSpec
@@ -1449,39 +958,23 @@ 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. If BOOST_PARAMETER_CAN_USE_MP11 is defined, then the default value of -Predicate is also a Boost.MP11-style that returns mp11::mp_true for any argument.

+

The default value of Predicate is an unspecified MPL Binary Metafunction +Class that returns mpl::true_ for any argument. If +BOOST_PARAMETER_CAN_USE_MP11 is defined, then the default value of +Predicate is also a Boost.MP11-style quoted metafunction that returns +mp11::mp_true for any argument.

-
-

4.5   deduced

+
+

4.5   deduced

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

+optional or required.

- - - + - - - +
Defined in:boost/parameter/deduced.hpp
Defined in:boost/parameter/deduced.hpp
Included by:boost/parameter/parameters.hpp
Included by:boost/parameter/preprocessor.hpp
@@ -1489,32 +982,30 @@ href="../../../../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
Requires:nothing
+
+
+
+
+

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
@@ -1529,39 +1020,24 @@ struct binding - -Requires: -A is a model of -ArgumentPack. +Requires:A must be 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. +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

+
+

5.2   lazy_binding

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

+tagged lazy default.

- - - +
Defined in:boost/parameter/binding.hpp
Defined in:boost/parameter/binding.hpp
@@ -1576,44 +1052,24 @@ struct lazy_binding - -Requires: -A is a model of -ArgumentPack. +Requires:A must be 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 +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

+
+

5.3   value_type

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

+keyword tag type or with a tagged default.

- - - +
Defined in:boost/parameter/value_type.hpp
Defined in:boost/parameter/value_type.hpp
@@ -1628,53 +1084,32 @@ struct value_type - -Requires: - -

A is a model of -ArgumentPack.

+Requires:

A must be 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:

+Returns:

the (possibly const-qualified) 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 boost::remove_reference<
-    typename binding<A, K, D>::type
+typename boost::remove_reference<
+    typename binding<A, K, D>::type
 >::type
 
-

… when D is not a reference -type.

+

… when D is not a reference type.

-
-

5.4   lazy_value_type

+
+

5.4   lazy_value_type

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

+tagged lazy default.

- - - +
Defined in:boost/parameter/value_type.hpp
Defined in:boost/parameter/value_type.hpp
@@ -1689,47 +1124,31 @@ struct lazy_value_type - -Requires: -A is a model of -ArgumentPack. +Requires:A must be a model of ArgumentPack. - -Returns: -the (possibly const-qualified) 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 +Returns:the (possibly const-qualified) 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.5   are_tagged_arguments

+
+

5.5   are_tagged_arguments

- - - +
Defined in:boost/parameter/are_tagged_arguments.hpp
Defined in:boost/parameter/are_tagged_arguments.hpp
 template <typename T0, typename ...Pack>
-struct are_tagged_arguments  // : mpl::true_ or mpl::false_
+struct are_tagged_arguments
+    // : mpl::true_ if T0 and all elements in Pack are
+    // tagged reference types, mpl::false_ otherwise.
 {
 };
 
@@ -1737,31 +1156,20 @@ struct are_tagged_arguments // : mpl::true_ or mpl::false_ - -Returns: +Returns:mpl::true_ if T0 and all elements in parameter pack Pack are +tagged reference types, mpl::false_ otherwise. - -  -mpl::true_ if T0 and all elements in parameter pack Pack are tagged reference types, mpl::false_ otherwise. +Example usage: - -Example usage: - - -  - -

When implementing a Boost.Parameter-enabled constructor for a -container that conforms to the C++ standard, one needs to remember that the -standard requires the presence of other constructors that are typically -defined as templates, such as range constructors. To avoid overload -ambiguities between the two constructors, use this metafunction in conjunction -with disable_if to define the range -constructor.

-
+
+
+

When implementing a Boost.Parameter-enabled constructor for a container that +conforms to the C++ standard, one needs to remember that the standard requires +the presence of other constructors that are typically defined as templates, +such as range constructors. To avoid overload ambiguities between the two +constructors, use this metafunction in conjunction with disable_if to +define the range constructor.

+
 template <typename B>
 class frontend : public B
 {
@@ -1770,16 +1178,13 @@ class frontend : public B
     };
 
  public:
-    BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(frontend, (B))
+    BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(frontend, (B))
 
     template <typename Iterator>
     frontend(
         Iterator itr
       , Iterator itr_end
-      , typename boost::disable_if<
+      , typename boost::disable_if<
             are_tagged_arguments<Iterator>
           , _enabler
         >::type = _enabler()
@@ -1788,29 +1193,22 @@ href="../../../core/doc/html/core/enable_if.html">disable_if<
     }
 };
 
- - - -
-
-

5.6   is_argument_pack

+
+

5.6   is_argument_pack

- - - +
Defined in:boost/parameter/is_argument_pack.hpp
Defined in:boost/parameter/is_argument_pack.hpp
 template <typename T>
-struct is_argument_pack  // : mpl::true_ or mpl::false_
+struct is_argument_pack
+    // : mpl::true_ if T is a model of ArgumentPack,
+    // mpl::false_ otherwise.
 {
 };
 
@@ -1818,30 +1216,18 @@ struct is_argument_pack // : mpl::true_ or mpl::false_ - -Returns: +Returns:mpl::true_ if T is a model of ArgumentPack, mpl::false_ +otherwise. - -  -mpl::true_ if T is a model of ArgumentPack, mpl::false_ otherwise. +Example usage: - -Example usage: - - -  - -

To avoid overload ambiguities between a constructor that -takes in an ArgumentPack and a templated conversion -constructor, use this metafunction in conjunction with enable_if.

-
-BOOST_PARAMETER_NAME(a0)
+
+
+

To avoid overload ambiguities between a constructor that takes in an +ArgumentPack and a templated conversion constructor, use this +metafunction in conjunction with enable_if.

+
+BOOST_PARAMETER_NAME(a0)
 
 template <typename T>
 class backend0
@@ -1856,8 +1242,7 @@ class backend0
     template <typename ArgPack>
     explicit backend0(
         ArgPack const& args
-      , typename boost::enable_if<
+      , typename boost::enable_if<
             is_argument_pack<ArgPack>
           , _enabler
         >::type = _enabler()
@@ -1868,11 +1253,8 @@ href="../../../core/doc/html/core/enable_if.html">enable_if<
     template <typename U>
     backend0(
         backend0<U> const& copy
-      , typename boost::enable_if<
-            boost::is_convertible<U,T>
+      , typename boost::enable_if<
+            boost::is_convertible<U,T>
           , _enabler
         >::type = _enabler()
     ) : a0(copy.get_a0())
@@ -1885,39 +1267,24 @@ href="../../../type_traits/doc/html/boost_typetraits/is_convertible.html"
     }
 };
 
- - - -
-
-

5.7   result_of::compose

-

Returns the result type of the compose() function.

+
+

5.7   result_of::compose

+

Returns the result type of the compose function.

- - - +
Defined in:boost/parameter/compose.hpp
Defined in:boost/parameter/compose.hpp
-namespace boost { namespace parameter { namespace result_of {
-
 template <typename ...TaggedArgs>
 struct compose
-  : boost::enable_if<
-        are_tagged_arguments<T0,Pack...>
-      , ArgumentPack
+  : boost::enable_if<
+        are_tagged_arguments<T0,Pack...>
+      , ArgumentPack
     >
 {
 };
@@ -1925,29 +1292,17 @@ class="concept">ArgumentPack
 template <>
 struct compose<>
 {
-    typedef empty ArgumentPack type;
+    typedef empty ArgumentPack type;
 };
-}}}
 
- - - + - - - +
Requires: -

All elements in TaggedArgs -must be tagged -reference types, if specified.

-
Requires:All elements in TaggedArgs must be tagged reference types, if +specified.
Returns: -

the result type of the compose() function.

-
Returns:the result type of the compose function.
@@ -1955,93 +1310,54 @@ href="#compose">compose() function.


-

6   Function -Templates

-
-

6.1   compose

+

6   Function Templates

+
+

6.1   compose

- - - +
Defined in:boost/parameter/compose.hpp
Defined in:boost/parameter/compose.hpp
 template <typename ...Pack>
-constexpr typename result_of::compose<Pack...>::type
+constexpr typename result_of::compose<Pack...>::type
     compose(Pack const&... args);
 
-

This function facilitates easier variadic argument composition. It is used -by the BOOST_PARAMETER_NO_SPEC_FUNCTION, BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION, BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION, BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR, BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR, BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR, and BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR -code generation macros. You can use it to write your own code generation -macros if the ones provided by this library do not suffice.

-

Unlike the tagged -reference comma operator, the compose() -function is variadic, as mentioned before. However, the tagged reference comma -operator can be invoked indefinitely and therefore does not limit the size of -the resulting ArgumentPack, while the compose() function cannot take in more than BOOST_PARAMETER_COMPOSE_MAX_ARITY arguments -for compilers that do not support perfect forwarding.

+

This function facilitates easier variadic argument composition. It is used by +the BOOST_PARAMETER_NO_SPEC_FUNCTION, +BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION, +BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION, +BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR, +BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR, +BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR, and +BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR code generation macros. You +can use it to write your own code generation macros if the ones provided by +this library do not suffice.

+

Unlike the tagged reference comma operator, the compose() function is +variadic, as mentioned before. However, the tagged reference comma operator +can be invoked indefinitely and therefore does not limit the size of the +resulting ArgumentPack, while the compose() function cannot take in more +than BOOST_PARAMETER_COMPOSE_MAX_ARITY arguments for compilers that do not +support perfect forwarding.

- - - + - - - + - - + - - +
Requires: -

All elements in args must -be tagged reference -objects, if specified.

-
Requires:All elements in args must be tagged reference objects, if +specified.
Returns: -

An ArgumentPack containing all elements in args, if specified; an empty ArgumentPack otherwise.

-
Returns:an ArgumentPack containing all elements in args, if +specified; an empty ArgumentPack otherwise.
Example usage:
Example usage:
+
+BOOST_PARAMETER_NAME(index)
 BOOST_PARAMETER_NAME(name)
 
 template <typename ArgumentPack>
@@ -2055,35 +1371,21 @@ int print_name_and_index(ArgumentPack const& args)
 
 int y = print_name_and_index(compose(_index = 3, _name = "jones"));
 
-

The test/compose.cpp test program shows more examples using this -function.

- - - - +

The compose.cpp test program shows more examples using this function.


-

7   Code Generation -Macros

-

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

-
-

7.1   BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, -arguments)

+

7   Code Generation Macros

+

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

+
+

7.1   BOOST_PARAMETER_FUNCTION(result, name, tag_namespace, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -2093,68 +1395,44 @@ arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -2166,86 +1444,63 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same -namespace, which is kw in this case. The -identifiers with leading underscores can be passed to the bracket operator of -args to extract the same argument to which -the corresponding named parameter (without underscores) is bound, as will be -shown later.

-
-BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
+

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same +namespace, which is kw in this case. The identifiers with leading +underscores can be passed to the bracket operator of args to extract the +same argument to which the corresponding named parameter (without underscores) +is bound, as will be shown later.

+
+BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
 

Use the macro as a substitute for a normal function header. Enclose the -return type bool in parentheses. For each -parameter, also enclose the expected value type in parentheses. Since the -value types are mutually exclusive, you can wrap the parameters in a (deduced …) clause. Otherwise, just as with a -normal function, the order in which you specify the parameters determines -their position. Also, just as with a normal function, optional parameters -have default values, whereas required parameters do not. Within the function -body, either simply use the parameter name or pass the matching identifier -with the leading underscore to the bracket operator of args to extract the corresponding -argument. Note that the second method doesn't require std::forward to preserve value categories.

-
+return type bool in parentheses.  For each parameter, also enclose the
+expected value type in parentheses.  Since the value types are mutually
+exclusive, you can wrap the parameters in a (deduced …)
+clause.  Otherwise, just as with a normal function, the order in which you
+specify the parameters determines their position.  Also, just as with a normal
+function, optional parameters have default values, whereas required parameters
+do not.  Within the function body, either simply use the parameter name or
+pass the matching identifier with the leading underscore to the bracket
+operator of args to extract the corresponding argument.  Note that the
+second method doesn't require std::forward to preserve value categories.

+
 BOOST_PARAMETER_FUNCTION((bool), evaluate, kw,
     (deduced
         (required
-            (lrc, (std::bitset<1>))
-            (lr, (std::bitset<2>))
+            (lrc, (std::bitset<1>))
+            (lr, (std::bitset<2>))
         )
         (optional
-            (rrc, (std::bitset<3>), rvalue_const_bitset<2>())
-            (rr, (std::bitset<4>), rvalue_bitset<3>())
+            (rrc, (std::bitset<3>), rvalue_const_bitset<2>())
+            (rr, (std::bitset<4>), rvalue_bitset<3>())
         )
     )
 )
@@ -2260,9 +1515,7 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
     );
     BOOST_TEST_EQ(
         passed_by_rvalue_reference_to_const
-      , U::evaluate_category<2>(std::forward<rrc0_type>(rrc0))
+      , U::evaluate_category<2>(std::forward<rrc0_type>(rrc0))
     );
     BOOST_TEST_EQ(
         passed_by_rvalue_reference
@@ -2273,7 +1526,7 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
 }
 

The following function calls are legal.

-
+
 evaluate(  // positional arguments
     lvalue_const_bitset<0>()
   , lvalue_bitset<1>()
@@ -2301,9 +1554,9 @@ evaluate(  // named arguments
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

Because the parameters were wrapped in a (deduced …) clause, the following function calls are also legal.

-
+

Because the parameters were wrapped in a (deduced …) clause, the following +function calls are also legal.

+
 evaluate(  // deduced arguments
     rvalue_bitset<3>()
   , lvalue_const_bitset<0>()
@@ -2315,40 +1568,21 @@ evaluate(  // deduced arguments
   , lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines 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.
  • +

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

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated forwarding functions.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -2371,91 +1605,51 @@ specifier-group1 ::=
     
     optional-specifier ::=
         '('
    -        argument-name ',' restriction ',' default-value
    +        argument-name ',' restriction ',' default-value
         ')'
     
     required-specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • 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.
    • -
    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • 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 Constant; 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.
    -
    -// If result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
    -using boost_param_result_ ## __LINE__ ## name = result;
    +using boost_param_result_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename Args>
    @@ -2465,7 +1659,7 @@ struct boost_param_result_ ## __LINE__ ## name
     };
     
     struct boost_param_params_ ## __LINE__ ## name
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -2475,31 +1669,22 @@ typedef boost_param_params_ ## __LINE__ ## name
         boost_param_parameters_ ## __LINE__ ## name;
     
     template <typename Args>
    -typename boost_param_result_ ## __LINE__ ## name ## _<Args>::type
    +typename boost_param_result_ ## __LINE__ ## name<Args>::type
         boost_param_impl ## __LINE__ ## 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()
    -    )
    +result 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 ## __LINE__ ## name(
             boost_param_parameters_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -2507,26 +1692,18 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     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()
    -    )
    +result 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 ## __LINE__ ## name(
             boost_param_parameters_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
    @@ -2542,11 +1719,9 @@ ResultType
         boost_param_dispatch_0boost_ ## __LINE__ ## name(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## n ## _type&& argument name ## n
    +      , argument name ## n ## _type&& argument name ## m
         );
     
     
    @@ -2562,48 +1737,35 @@ ResultType
         boost_param_dispatch_0boost_ ## __LINE__ ## name(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## m ## _type&& argument name ## m
    +      , argument name ## m ## _type&& argument name ## m
         );
     
     template <typename Args>
    -typename boost_param_result_ ## __LINE__ ## name<Args>::type
    -    boost_param_impl ## __LINE__ ## name(Args const& args)
    +typename boost_param_result_ ## __LINE__ ## name<Args>::type
    +    boost_param_impl ## __LINE__ ## name(Args const& args)
     {
         return boost_param_dispatch_0boost_ ## __LINE__ ## name(
             static_cast<
    -            typename boost_param_result_ ## __LINE__ ## name<
    +            typename boost_param_result_ ## __LINE__ ## name<
                     Args
                 >::type(*)()
    -        >(nullptr)
    +        >(std::nullptr)
           , args
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## 0
    +              , keyword tag type of required parameter ## 0
                 >::type
    -        >(args[ keyword object of required parameter ## 0])
    +        >(args[ keyword object of required parameter ## 0])
           , …
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## n
    +              , keyword tag type of required parameter ## n
                 >::type
    -        >(args[ keyword object of required parameter ## n])
    +        >(args[ keyword object of required parameter ## n])
         );
     }
     
    @@ -2618,42 +1780,29 @@ ResultType
         boost_param_dispatch_0boost_ ## __LINE__ ## name(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## n ## _type&& argument name ## n
    +      , argument name ## n ## _type&& argument name ## n
         )
     {
         return boost_param_dispatch_0boost_ ## __LINE__ ## name(
    -        static_cast<ResultType(*)()>(nullptr)
    -      , (args, keyword object of optional parameter ## n + 1 =
    -            default value of optional parameter ## n + 1
    +        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>(
    +      , std::forward<argument name ## 0 ## _type>(
                 argument name ## 0
             )
           , …
    -      , std::forward< argument name ## n ## _type>(
    +      , std::forward<argument name ## n ## _type>(
                 argument name ## n
             )
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of optional parameter ## n + 1
    +              , keyword tag type of optional parameter ## n + 1
                 >::type
    -        >(default value of optional parameter ## n + 1)
    +        >(default value of optional parameter ## n + 1)
         );
     }
     
    @@ -2670,30 +1819,19 @@ ResultType
         boost_param_dispatch_0boost_ ## __LINE__ ## name(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## m ## _type&& argument name ## m
    +      , argument name ## m ## _type&& argument name ## m
         )
     
    -
    -
-
-

7.2   BOOST_PARAMETER_MEMBER_FUNCTION(result, name, -tag_namespace, arguments)

+
+

7.2   BOOST_PARAMETER_MEMBER_FUNCTION(result, name, tag_namespace, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -2703,68 +1841,44 @@ arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -2776,89 +1890,65 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same -namespace, which is kw in this case. The -identifiers with leading underscores can be passed to the bracket operator of -args to extract the same argument to which -the corresponding named parameter (without underscores) is bound, as will be -shown later.

-
-BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
+

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same +namespace, which is kw in this case. The identifiers with leading +underscores can be passed to the bracket operator of args to extract the +same argument to which the corresponding named parameter (without underscores) +is bound, as will be shown later.

+
+BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
 
-

Use the macro as a substitute for a normal static member function header. Enclose the return type bool in parentheses. For each parameter, also -enclose the expected value type in parentheses. Since the value types are -mutually exclusive, you can wrap the parameters in a (deduced …) clause. Otherwise, just as with a -normal function, the order in which you specify the parameters determines -their position. Also, just as with a normal function, optional parameters -have default values, whereas required parameters do not. Within the function -body, either simply use the parameter name or pass the matching identifier -with the leading underscore to the bracket operator of args to extract the corresponding -argument. Note that the second method doesn't require std::forward to preserve value categories.

-
+

Use the macro as a substitute for a normal static member function +header. Enclose the return type bool in parentheses. For each parameter, +also enclose the expected value type in parentheses. Since the value types +are mutually exclusive, you can wrap the parameters in a (deduced …) +clause. Otherwise, just as with a normal function, the order in which you +specify the parameters determines their position. Also, just as with a normal +function, optional parameters have default values, whereas required parameters +do not. Within the function body, either simply use the parameter name or +pass the matching identifier with the leading underscore to the bracket +operator of args to extract the corresponding argument. Note that the +second method doesn't require std::forward to preserve value categories.

+
 struct B
 {
     BOOST_PARAMETER_MEMBER_FUNCTION((bool), static evaluate, kw,
         (deduced
             (required
-                (lrc, (std::bitset<1>))
-                (lr, (std::bitset<2>))
+                (lrc, (std::bitset<1>))
+                (lr, (std::bitset<2>))
             )
             (optional
-                (rrc, (std::bitset<3>), rvalue_const_bitset<2>())
-                (rr, (std::bitset<4>), rvalue_bitset<3>())
+                (rrc, (std::bitset<3>), rvalue_const_bitset<2>())
+                (rr, (std::bitset<4>), rvalue_bitset<3>())
             )
         )
     )
@@ -2873,9 +1963,7 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference_to_const
-          , U::evaluate_category<2>(std::forward<rrc0_type>(rrc0))
+          , U::evaluate_category<2>(std::forward<rrc0_type>(rrc0))
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference
@@ -2887,7 +1975,7 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
 };
 

The following function calls are legal.

-
+
 B::evaluate(  // positional arguments
     lvalue_const_bitset<0>()
   , lvalue_bitset<1>()
@@ -2915,9 +2003,9 @@ B::evaluate(  // named arguments
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

Because the parameters were wrapped in a (deduced …) clause, the following function calls are also legal.

-
+

Because the parameters were wrapped in a (deduced …) clause, the following +function calls are also legal.

+
 B::evaluate(  // deduced arguments
     rvalue_bitset<3>()
   , lvalue_const_bitset<0>()
@@ -2929,41 +2017,22 @@ B::evaluate(  // deduced arguments
   , lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines the name of the generated forwarding functions. 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.
  • -
  • tag_namespace is the namespace in which -the keywords used by the function resides.
  • -
  • arguments is a list of argument -specifiers, as defined below.
  • +

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

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated forwarding functions. 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.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -2986,91 +2055,51 @@ specifier-group1 ::=
     
     optional-specifier ::=
         '('
    -        argument-name ',' restriction ',' default-value
    +        argument-name ',' restriction ',' default-value
         ')'
     
     required-specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • 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.
    • -
    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • 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 Constant; 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.
    -
    -// If result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
    -using boost_param_result_ ## __LINE__ ## name = result;
    +using boost_param_result_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename Args>
    @@ -3080,7 +2109,7 @@ struct boost_param_result_ ## __LINE__ ## name
     };
     
     struct boost_param_params_ ## __LINE__ ## name
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -3090,24 +2119,18 @@ typedef boost_param_params_ ## __LINE__ ## name
         boost_param_parameters_ ## __LINE__ ## name;
     
     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()
    -    )
    +result name(
    +    A0&& a0, …, A ## n&& a ## n
    +  , typename boost_param_parameters_ ## __LINE__ ## name
    +    ::match<A0, …, A ## n>::type
    +    = boost_param_parameters_ ## __LINE__ ## name()
    +)
     {
         return this->boost_param_impl ## __LINE__ ## name(
             boost_param_parameters_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -3115,65 +2138,46 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     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()
    -    )
    +result name(
    +    A0&& a0, …, A ## m&& a ## m
    +  , typename boost_param_parameters_ ## __LINE__ ## name
    +    ::match<A0, …, A ## m>::type
    +    = boost_param_parameters_ ## __LINE__ ## name()
    +)
     {
         return this->boost_param_impl ## __LINE__ ## name(
             boost_param_parameters_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
     
     template <typename Args>
    -typename boost_param_result_ ## __LINE__ ## name<Args>::type
    -    boost_param_impl ## __LINE__ ## name(Args const& args)
    +typename boost_param_result_ ## __LINE__ ## name<Args>::type
    +    boost_param_impl ## __LINE__ ## name(Args const& args)
     {
    -    return this->boost_param_dispatch_0boost_ ## __LINE__ ## name(
    +    return this->boost_param_dispatch_0boost_ ## __LINE__ ## name(
             static_cast<
    -            typename boost_param_result_ ## __LINE__ ## name<
    +            typename boost_param_result_ ## __LINE__ ## name<
                     Args
                 >::type(*)()
    -        >(nullptr)
    +        >(std::nullptr)
           , args
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## 0
    +              , keyword tag type of required parameter ## 0
                 >::type
    -        >(args[ keyword object of required parameter ## 0])
    +        >(args[ keyword object of required parameter ## 0])
           , …
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## n
    +              , keyword tag type of required parameter ## n
                 >::type
    -        >(args[ keyword object of required parameter ## n])
    +        >(args[ keyword object of required parameter ## n])
         );
     }
     
    @@ -3188,43 +2192,29 @@ ResultType
         boost_param_dispatch_0boost_ ## __LINE__ ## name(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## n ## _type&& argument name ## n
    +      , argument name ## n ## _type&& argument name ## n
         )
     {
    -    return this->boost_param_dispatch_0boost_ ## __LINE__ ## name(
    -        static_cast<ResultType(*)()>(nullptr)
    -      , (args, keyword object of optional parameter ## n + 1 =
    -            default value of optional parameter ## n + 1
    +    return this->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>(
    +      , std::forward<argument name ## 0 ## _type>(
                 argument name ## 0
             )
           , …
    -      , std::forward< argument name ## n ## _type>(
    +      , std::forward<argument name ## n ## _type>(
                 argument name ## n
             )
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of optional parameter ## n + 1
    +              , keyword tag type of optional parameter ## n + 1
                 >::type
    -        >(default value of optional parameter ## n + 1)
    +        >(default value of optional parameter ## n + 1)
         );
     }
     
    @@ -3241,30 +2231,19 @@ ResultType
         boost_param_dispatch_0boost_ ## __LINE__ ## name(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## m ## _type&& argument name ## m
    +      , argument name ## m ## _type&& argument name ## m
         )
     
    -
    -
-
-

7.3   BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, -tag_namespace, arguments)

+
+

7.3   BOOST_PARAMETER_CONST_MEMBER_FUNCTION(result, name, tag_ns, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -3274,68 +2253,44 @@ arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -3347,70 +2302,54 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same -namespace, which is kw in this case. The -identifiers with leading underscores can be passed to the bracket operator of -args to extract the same argument to which -the corresponding named parameter (without underscores) is bound, as will be -shown later.

-
-BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
+

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same +namespace, which is kw in this case. The identifiers with leading +underscores can be passed to the bracket operator of args to extract the +same argument to which the corresponding named parameter (without underscores) +is bound, as will be shown later.

+
+BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
 
-

Use the macro as a substitute for a normal const member function header. Enclose the return type bool in parentheses. For each parameter, also -enclose the expected value type in parentheses. Since the value types are -mutually exclusive, you can wrap the parameters in a (deduced …) clause. Otherwise, just as with a -normal function, the order in which you specify the parameters determines -their position. Also, just as with a normal function, optional parameters -have default values, whereas required parameters do not. Within the function -body, either simply use the parameter name or pass the matching identifier -with the leading underscore to the bracket operator of args to extract the corresponding -argument. Note that the second method doesn't require std::forward to preserve value categories.

-
+

Use the macro as a substitute for a normal const member function +header. Enclose the return type bool in parentheses. For each parameter, +also enclose the expected value type in parentheses. Since the value types +are mutually exclusive, you can wrap the parameters in a (deduced …) +clause. Otherwise, just as with a normal function, the order in which you +specify the parameters determines their position. Also, just as with a normal +function, optional parameters have default values, whereas required parameters +do not. Within the function body, either simply use the parameter name or +pass the matching identifier with the leading underscore to the bracket +operator of args to extract the corresponding argument. Note that the +second method doesn't require std::forward to preserve value categories.

+
 struct B
 {
     B()
@@ -3420,20 +2359,12 @@ struct B
     BOOST_PARAMETER_CONST_MEMBER_FUNCTION((bool), evaluate, kw,
         (deduced
             (required
-                (lrc, (std::bitset<1>))
-                (lr, (std::bitset<2>))
+                (lrc, (std::bitset<1>))
+                (lr, (std::bitset<2>))
             )
             (optional
-                (rrc, (std::bitset<3>), rvalue_const_bitset<2>())
-                (rr, (std::bitset<4>), rvalue_bitset<3>())
+                (rrc, (std::bitset<3>), rvalue_const_bitset<2>())
+                (rr, (std::bitset<4>), rvalue_bitset<3>())
             )
         )
     )
@@ -3448,9 +2379,7 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference_to_const
-          , U::evaluate_category<2>(std::forward<rrc0_type>(rrc0))
+          , U::evaluate_category<2>(std::forward<rrc0_type>(rrc0))
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference
@@ -3462,7 +2391,7 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
 };
 

The following function calls are legal.

-
+
 B const b = B();
 b.evaluate(  // positional arguments
     lvalue_const_bitset<0>()
@@ -3491,9 +2420,9 @@ b.evaluate(  // named arguments
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

Because the parameters were wrapped in a (deduced …) clause, the following function calls are also legal.

-
+

Because the parameters were wrapped in a (deduced …) clause, the following +function calls are also legal.

+
 b.evaluate(  // deduced arguments
     rvalue_bitset<3>()
   , lvalue_const_bitset<0>()
@@ -3505,36 +2434,19 @@ b.evaluate(  // deduced arguments
   , lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines 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.
  • +

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

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated forwarding functions.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -3557,91 +2469,51 @@ specifier-group1 ::=
     
     optional-specifier ::=
         '('
    -        argument-name ',' restriction ',' default-value
    +        argument-name ',' restriction ',' default-value
         ')'
     
     required-specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • 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.
    • -
    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • 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 Constant; 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.
    -
    -// If result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
    -using boost_param_result_const_ ## __LINE__ ## name = result;
    +using boost_param_result_const_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename Args>
    @@ -3651,7 +2523,7 @@ struct boost_param_result_const_ ## __LINE__ ## name
     };
     
     struct boost_param_params_const_ ## __LINE__ ## name
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -3661,26 +2533,18 @@ typedef boost_param_params_const_ ## __LINE__ ## name
         boost_param_parameters_const_ ## __LINE__ ## name;
     
     template <typename A0, …, typename A ## n>
    -result type
    -    name(
    -        A0&& a0, …, A ## n && a ## n
    -      , typename boost_param_parameters_const_ ## __LINE__ ## name
    -        ::match<A0, …, A ## n>::type
    -        = boost_param_parameters_const_ ## __LINE__ ## name()
    -    ) const
    +result name(
    +    A0&& a0, …, A ## n&& a ## n
    +  , typename boost_param_parameters_const_ ## __LINE__ ## name
    +    ::match<A0, …, A ## n>::type
    +    = boost_param_parameters_const_ ## __LINE__ ## name()
    +) const
     {
    -    return this->boost_param_impl_const ## __LINE__ ## name(
    -        boost_param_parameters_const_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +    return this->boost_param_impl_const ## __LINE__ ## name(
    +        boost_param_parameters_const_ ## __LINE__ ## name(
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -3688,67 +2552,47 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     template <typename A0, …, typename A ## m>
    -result type
    -    name(
    -        A0&& a0, …, A ## m && a ## m
    -      , typename boost_param_parameters_const_ ## __LINE__ ## name
    -        ::match<A0, …, A ## m>::type
    -        = boost_param_parameters_const_ ## __LINE__ ## name()
    -    ) const
    +result name(
    +    A0&& a0, …, A ## m&& a ## m
    +  , typename boost_param_parameters_const_ ## __LINE__ ## name
    +    ::match<A0, …, A ## m>::type
    +    = boost_param_parameters_const_ ## __LINE__ ## name()
    +) const
     {
    -    return this->boost_param_impl_const ## __LINE__ ## name(
    +    return this->boost_param_impl_const ## __LINE__ ## name(
             boost_param_parameters_const_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
     
     template <typename Args>
    -typename boost_param_result_const_ ## __LINE__ ## name<Args>::type
    -    boost_param_impl_const ## __LINE__ ## name(Args const& args) const
    +typename boost_param_result_const_ ## __LINE__ ## name<Args>::type
    +    boost_param_impl_const ## __LINE__ ## name(Args const& args) const
     {
         return this->
         boost_param_dispatch_const_0boost_ ## __LINE__ ## name(
             static_cast<
    -            typename boost_param_result_const_ ## __LINE__ ## name<
    +            typename boost_param_result_const_ ## __LINE__ ## name<
                     Args
                 >::type(*)()
    -        >(nullptr)
    +        >(std::nullptr)
           , args
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## 0
    +              , keyword tag type of required parameter ## 0
                 >::type
    -        >(args[ keyword object of required parameter ## 0])
    +        >(args[ keyword object of required parameter ## 0])
           , …
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## n
    +              , keyword tag type of required parameter ## n
                 >::type
    -        >(args[ keyword object of required parameter ## n])
    +        >(args[ keyword object of required parameter ## n])
         );
     }
     
    @@ -3763,43 +2607,30 @@ ResultType
         boost_param_dispatch_const_0boost_ ## __LINE__ ## name(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## n ## _type&& argument name ## n
    +      , argument name ## n ## _type&& argument name ## n
         ) const
     {
         return this->
         boost_param_dispatch_const_0boost_ ## __LINE__ ## name(
    -        static_cast<ResultType(*)()>(nullptr)
    -      , (args, keyword object of optional parameter ## n + 1 =
    -            default value of optional parameter ## n + 1
    +        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>(
    +      , std::forward<argument name ## 0 ## _type>(
                 argument name ## 0
             )
           , …
    -      , std::forward< argument name ## n ## _type>(
    +      , std::forward<argument name ## n ## _type>(
                 argument name ## n
             )
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of optional parameter ## n + 1
    +              , keyword tag type of optional parameter ## n + 1
                 >::type
    -        >(default value of optional parameter ## n + 1)
    +        >(default value of optional parameter ## n + 1)
         );
     }
     
    @@ -3816,30 +2647,19 @@ ResultType
         boost_param_dispatch_const_0boost_ ## __LINE__ ## name(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## m ## _type&& argument name ## m
    +      , argument name ## m ## _type&& argument name ## m
         ) const
     
    -
    -
-
-

7.4   BOOST_PARAMETER_FUNCTION_CALL_OPERATOR(result, -tag_ns, arguments)

+
+

7.4   BOOST_PARAMETER_FUNCTION_CALL_OPERATOR(result, tag_namespace, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -3849,29 +2669,24 @@ composed arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - -

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same + + +

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same namespace, which is tag by default.

-
-BOOST_PARAMETER_NAME(y)
-BOOST_PARAMETER_NAME(z)
+
+BOOST_PARAMETER_NAME(y)
+BOOST_PARAMETER_NAME(z)
 

Use the macro as a substitute for a normal function call operator header. Enclose the return type in parentheses. For each parameter, also enclose the expected value type in parentheses. Since the value types are -mutually exclusive, you can wrap the parameters in a (deduced …) clause. This is especially useful -when implementing multiple Boost.Parameter-enabled function call operator -overloads.

-
+mutually exclusive, you can wrap the parameters in a (deduced …)
+clause.  This is especially useful when implementing multiple
+Boost.Parameter-enabled function call operator overloads.

+
 class char_reader
 {
     int index;
@@ -3895,16 +2710,11 @@ class char_reader
         this->key = z;
     }
 
-    BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((char), tag,
+    BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((char), tag,
         (deduced
             (required
                 (y, (bool))
-                (z, (std::map<char const*,std::string>))
+                (z, (std::map<char const*, std::string>))
             )
         )
     )
@@ -3917,22 +2727,12 @@ href="http://en.cppreference.com/w/cpp/string/basic_string">string>))
 

As with regular argument-dependent lookup, the value types of the arguments passed in determine which function call operator overload gets invoked.

-
-char const* keys[] = {"foo", "bar", "baz"};
-std::map<char const*,std::string> k2s;
-k2s[keys[0]] = std::string>("qux");
-k2s[keys[1]] = std::string>("wmb");
-k2s[keys[2]] = std::string>("zxc");
+
+char const* keys[] = {"foo", "bar", "baz"};
+std::map<char const*, std::string> k2s;
+k2s[keys[0]] = std::string("qux");
+k2s[keys[1]] = std::string("wmb");
+k2s[keys[2]] = std::string("zxc");
 char_reader r(keys[0]);
 
 // positional arguments
@@ -3949,35 +2749,18 @@ r(keys[2], 2);
 BOOST_TEST_EQ('c', (r(k2s, true)));
 BOOST_TEST_EQ('z', (r(k2s, false)));
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function call operator.
  • -
  • tag_namespace is the namespace in which -the keywords used by the function call operator resides.
  • -
  • arguments is a list of argument -specifiers, as defined below.
  • +

    The preprocessor.cpp and preprocessor_deduced.cpp test programs +demonstrate proper usage of this macro.

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function call operator.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function call operator resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -4000,88 +2783,49 @@ specifier-group1 ::=
     
     optional-specifier ::=
         '('
    -        argument-name ',' restriction ',' default-value
    +        argument-name ',' restriction ',' default-value
         ')'
     
     required-specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • 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.
    • -
    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • 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 Constant; 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.
    -
    -// If result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
     using boost_param_result_ ## __LINE__ ## operator = result;
     
    @@ -4093,7 +2837,7 @@ struct boost_param_result_ ## __LINE__ ## operator
     };
     
     struct boost_param_params_ ## __LINE__ ## operator
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -4103,24 +2847,18 @@ typedef boost_param_params_ ## __LINE__ ## operator
         boost_param_parameters_ ## __LINE__ ## operator;
     
     template <typename A0, …, typename A ## n>
    -result type
    -    operator()(
    -        A0&& a0, …, A ## n && a ## n
    -      , typename boost_param_parameters_ ## __LINE__ ## operator
    -        ::match<A0, …, A ## n>::type
    -        = boost_param_parameters_ ## __LINE__ ## operator()
    -    )
    +result operator()(
    +    A0&& a0, …, A ## n&& a ## n
    +  , typename boost_param_parameters_ ## __LINE__ ## operator::match<
    +        A0, …, A ## n
    +    >::type = boost_param_parameters_ ## __LINE__ ## operator()
    +)
     {
         return this->boost_param_impl ## __LINE__ ## operator(
             boost_param_parameters_ ## __LINE__ ## operator()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -4128,24 +2866,18 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     template <typename A0, …, typename A ## m>
    -result type
    -    operator()(
    -        A0&& a0, …, A ## m && a ## m
    -      , typename boost_param_parameters_ ## __LINE__ ## operator
    -        ::match<A0, …, A ## m>::type
    -        = boost_param_parameters_ ## __LINE__ ## operator()
    -    )
    +result operator()(
    +    A0&& a0, …, A ## m&& a ## m
    +  , typename boost_param_parameters_ ## __LINE__ ## operator::match<
    +        A0, …, A ## m
    +    >::type = boost_param_parameters_ ## __LINE__ ## operator()
    +)
     {
         return this->boost_param_impl ## __LINE__ ## operator(
             boost_param_parameters_ ## __LINE__ ## operator()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
    @@ -4159,30 +2891,21 @@ typename boost_param_result_ ## __LINE__ ## operator<Args>::type
                 typename boost_param_result_ ## __LINE__ ## operator<
                     Args
                 >::type(*)()
    -        >(nullptr)
    +        >(std::nullptr)
           , args
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## 0
    +              , keyword tag type of required parameter ## 0
                 >::type
    -        >(args[ keyword object of required parameter ## 0])
    +        >(args[ keyword object of required parameter ## 0])
           , …
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## n
    +              , keyword tag type of required parameter ## n
                 >::type
    -        >(args[ keyword object of required parameter ## n])
    +        >(args[ keyword object of required parameter ## n])
         );
     }
     
    @@ -4197,42 +2920,29 @@ ResultType
         boost_param_dispatch_0boost_ ## __LINE__ ## operator(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## n ## _type&& argument name ## n
    +      , argument name ## n ## _type&& argument name ## n
         )
     {
         return this->boost_param_dispatch_0boost_ ## __LINE__ ## operator(
    -        static_cast<ResultType(*)()>(nullptr)
    -      , (args, keyword object of optional parameter ## n + 1 =
    -            default value of optional parameter ## n + 1
    +        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>(
    +      , std::forward<argument name ## 0 ## _type>(
                 argument name ## 0
             )
           , …
    -      , std::forward< argument name ## n ## _type>(
    +      , std::forward<argument name ## n ## _type>(
                 argument name ## n
             )
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of optional parameter ## n + 1
    +              , keyword tag type of optional parameter ## n + 1
                 >::type
    -        >(default value of optional parameter ## n + 1)
    +        >(default value of optional parameter ## n + 1)
         );
     }
     
    @@ -4249,30 +2959,19 @@ ResultType
         boost_param_dispatch_0boost_ ## __LINE__ ## operator(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## m ## _type&& argument name ## m
    +      , argument name ## m ## _type&& argument name ## m
         )
     
    -
    -
-
-

7.5   BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR(result, -tag_ns, arguments)

+
+

7.5   BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -4282,68 +2981,44 @@ composed arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -4355,70 +3030,54 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same -namespace, which is kw in this case. The -identifiers with leading underscores can be passed to the bracket operator of -args to extract the same argument to which -the corresponding named parameter (without underscores) is bound, as will be -shown later.

-
-BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
+

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same +namespace, which is kw in this case. The identifiers with leading +underscores can be passed to the bracket operator of args to extract the +same argument to which the corresponding named parameter (without underscores) +is bound, as will be shown later.

+
+BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
 
-

Use the macro as a substitute for a normal const function call operator header. Enclose the return type bool in parentheses. For each parameter, also -enclose the expected value type in parentheses. Since the value types are -mutually exclusive, you can wrap the parameters in a (deduced …) clause. Otherwise, just as with a -normal function, the order in which you specify the parameters determines -their position. Also, just as with a normal function, optional parameters -have default values, whereas required parameters do not. Within the function -body, either simply use the parameter name or pass the matching identifier -with the leading underscore to the bracket operator of args to extract the corresponding -argument. Note that the second method doesn't require std::forward to preserve value categories.

-
+

Use the macro as a substitute for a normal const function call operator +header. Enclose the return type bool in parentheses. For each parameter, +also enclose the expected value type in parentheses. Since the value types +are mutually exclusive, you can wrap the parameters in a (deduced …) +clause. Otherwise, just as with a normal function, the order in which you +specify the parameters determines their position. Also, just as with a normal +function, optional parameters have default values, whereas required parameters +do not. Within the function body, either simply use the parameter name or +pass the matching identifier with the leading underscore to the bracket +operator of args to extract the corresponding argument. Note that the +second method doesn't require std::forward to preserve value categories.

+
 struct B
 {
     B()
@@ -4428,20 +3087,12 @@ struct B
     BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((bool), kw,
         (deduced
             (required
-                (lrc, (std::bitset<1>))
-                (lr, (std::bitset<2>))
+                (lrc, (std::bitset<1>))
+                (lr, (std::bitset<2>))
             )
             (optional
-                (rrc, (std::bitset<3>), rvalue_const_bitset<2>())
-                (rr, (std::bitset<4>), rvalue_bitset<3>())
+                (rrc, (std::bitset<3>), rvalue_const_bitset<2>())
+                (rr, (std::bitset<4>), rvalue_bitset<3>())
             )
         )
     )
@@ -4456,9 +3107,7 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference_to_const
-          , U::evaluate_category<2>(std::forward<rrc0_type>(rrc0))
+          , U::evaluate_category<2>(std::forward<rrc0_type>(rrc0))
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference
@@ -4470,7 +3119,7 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
 };
 

The following function calls are legal.

-
+
 B const b = B();
 b(  // positional arguments
     lvalue_const_bitset<0>()
@@ -4499,9 +3148,9 @@ b(  // named arguments
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

Because the parameters were wrapped in a (deduced …) clause, the following function calls are also legal.

-
+

Because the parameters were wrapped in a (deduced …) clause, the following +function calls are also legal.

+
 b(  // deduced arguments
     rvalue_bitset<3>()
   , lvalue_const_bitset<0>()
@@ -4513,38 +3162,19 @@ b(  // deduced arguments
   , lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function call operator.
  • -
  • tag_namespace is the namespace in which -the keywords used by the function call operator resides.
  • -
  • arguments is a list of argument -specifiers, as defined below.
  • +

    The preprocessor.cpp, preprocessor_deduced.cpp, and +preprocessor_eval_cat_8.cpp test programs demonstrate proper usage of this +macro.

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function call operator.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function call operator resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -4567,91 +3197,51 @@ specifier-group1 ::=
     
     optional-specifier ::=
         '('
    -        argument-name ',' restriction ',' default-value
    +        argument-name ',' restriction ',' default-value
         ')'
     
     required-specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • 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.
    • -
    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • 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 Constant; 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.
    -
    -// If result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
    -using boost_param_result_const_ ## __LINE__ ## operator = result;
    +using boost_param_result_const_ ## __LINE__ ## operator = result;
     
     // If result is a simple return type:
     template <typename Args>
    @@ -4661,7 +3251,7 @@ struct boost_param_result_const_ ## __LINE__ ## operator
     };
     
     struct boost_param_params_const_ ## __LINE__ ## operator
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -4671,24 +3261,18 @@ typedef boost_param_params_const_ ## __LINE__ ## operator
         boost_param_parameters_const_ ## __LINE__ ## operator;
     
     template <typename A0, …, typename A ## n>
    -result type
    -    operator()(
    -        A0&& a0, …, A ## n && a ## n
    -      , typename boost_param_parameters_const_ ## __LINE__ ## operator
    -        ::match<A0, …, A ## n>::type
    -        = boost_param_parameters_const_ ## __LINE__ ## operator()
    -    ) const
    +result operator()(
    +    A0&& a0, …, A ## n&& a ## n
    +  , typename boost_param_parameters_const_ ## __LINE__ ## operator
    +    ::match<A0, …, A ## n>::type
    +    = boost_param_parameters_const_ ## __LINE__ ## operator()
    +) const
     {
         return this->boost_param_impl_const ## __LINE__ ## operator(
             boost_param_parameters_const_ ## __LINE__ ## operator()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -4696,24 +3280,18 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     template <typename A0, …, typename A ## m>
    -result type
    -    operator()(
    -        A0&& a0, …, A ## m && a ## m
    -      , typename boost_param_parameters_const_ ## __LINE__ ## operator
    -        ::match<A0, …, A ## m>::type
    -        = boost_param_parameters_const_ ## __LINE__ ## operator()
    -    ) const
    +result operator()(
    +    A0&& a0, …, A ## m&& a ## m
    +  , typename boost_param_parameters_const_ ## __LINE__ ## operator
    +    ::match<A0, …, A ## m>::type
    +    = boost_param_parameters_const_ ## __LINE__ ## operator()
    +) const
     {
         return this->boost_param_impl_const ## __LINE__ ## operator(
             boost_param_parameters_const_ ## __LINE__ ## operator()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
    @@ -4728,30 +3306,21 @@ typename boost_param_result_const_ ## __LINE__ ## operator<Args>::type
                 typename boost_param_result_const_ ## __LINE__ ## operator<
                     Args
                 >::type(*)()
    -        >(nullptr)
    +        >(std::nullptr)
           , args
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## 0
    +              , keyword tag type of required parameter ## 0
                 >::type
    -        >(args[ keyword object of required parameter ## 0])
    +        >(args[ keyword object of required parameter ## 0])
           , …
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of required parameter ## n
    +              , keyword tag type of required parameter ## n
                 >::type
    -        >(args[ keyword object of required parameter ## n])
    +        >(args[ keyword object of required parameter ## n])
         );
     }
     
    @@ -4766,43 +3335,30 @@ ResultType
         boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## n ## _type&& argument name ## n
    +      , argument name ## n ## _type&& argument name ## n
         ) const
     {
         return this->
         boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
    -        static_cast<ResultType(*)()>(nullptr)
    -      , (args, keyword object of optional parameter ## n + 1 =
    -            default value of optional parameter ## n + 1
    +        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>(
    +      , std::forward<argument name ## 0 ## _type>(
                 argument name ## 0
             )
           , …
    -      , std::forward< argument name ## n ## _type>(
    +      , std::forward<argument name ## n ## _type>(
                 argument name ## n
             )
    -      , std::forward<
    -            typename value_type<
    +      , std::forward<
    +            typename value_type<
                     Args
    -              , keyword tag type of optional parameter ## n + 1
    +              , keyword tag type of optional parameter ## n + 1
                 >::type
    -        >(default value of optional parameter ## n + 1)
    +        >(default value of optional parameter ## n + 1)
         );
     }
     
    @@ -4819,30 +3375,19 @@ ResultType
         boost_param_dispatch_const_0boost_ ## __LINE__ ## operator(
             (ResultType(*)())
           , Args const& args
    -      , argument name ## 0 ## _type&& argument name ## 0
    +      , argument name ## 0 ## _type&& argument name ## 0
           , …
    -      , argument name ## m ## _type&& argument name ## m
    +      , argument name ## m ## _type&& argument name ## m
         ) const
     
    -
    -
-
-

7.6   BOOST_PARAMETER_CONSTRUCTOR(cls, impl, tag_namespace, -arguments)

+
+

7.6   BOOST_PARAMETER_CONSTRUCTOR(cls, impl, tag_namespace, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -4852,27 +3397,21 @@ arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - -

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same + + +

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same namespace, which is tag by default.

-
-BOOST_PARAMETER_NAME(y)
-BOOST_PARAMETER_NAME(z)
+
+BOOST_PARAMETER_NAME(y)
+BOOST_PARAMETER_NAME(z)
 
-

In the base class, implement a delegate constructor template that takes in -an ArgumentPack. You must pass the identifiers with leading -underscores to args in order to extract the -corresponding arguments.

-
+

In the base class, implement a delegate constructor template that takes in an +ArgumentPack. You must pass the identifiers with leading underscores to +args in order to extract the corresponding arguments.

+
 class char_read_base
 {
     int index;
@@ -4885,30 +3424,11 @@ class char_read_base
     {
     }
 
-    BOOST_PARAMETER_FUNCTION_CALL_OPERATOR((void), tag,
-        (deduced
-            (required
-                (y, (int))
-                (z, (char const*))
-            )
-        )
-    )
-    {
-        this->index = y;
-        this->key = z;
-    }
-
-    BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((char), tag,
+    BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((char), tag,
         (deduced
             (required
                 (y, (bool))
-                (z, (std::map<char const*,std::string>))
+                (z, (std::map<char const*, std::string>))
             )
         )
     )
@@ -4919,12 +3439,12 @@ href="http://en.cppreference.com/w/cpp/string/basic_string"
     }
 };
 
-

Use the macro as a substitute for a normal constructor definition. Note -the lack of an explicit body. Enclose the base type in parentheses. For each +

Use the macro as a substitute for a normal constructor definition. Note the +lack of an explicit body. Enclose the base type in parentheses. For each parameter, also enclose the expected value type in parentheses. Since the -value types are mutually exclusive, you can wrap the parameters in a (deduced …) clause.

-
+value types are mutually exclusive, you can wrap the parameters in a
+(deduced …) clause.

+
 struct char_reader : public char_read_base
 {
     BOOST_PARAMETER_CONSTRUCTOR(char_reader, (char_read_base), tag,
@@ -4937,24 +3457,13 @@ struct char_reader : public char_read_base
     )
 };
 
-

The following char_reader constructor -calls are legal.

-
-char const* keys[] = {"foo", "bar", "baz"};
-std::map<char const*,std::string> k2s;
-k2s[keys[0]] = std::string>("qux");
-k2s[keys[1]] = std::string>("wmb");
-k2s[keys[2]] = std::string>("zxc");
+

The following char_reader constructor calls are legal.

+
+char const* keys[] = {"foo", "bar", "baz"};
+std::map<char const*, std::string> k2s;
+k2s[keys[0]] = std::string("qux");
+k2s[keys[1]] = std::string("wmb");
+k2s[keys[2]] = std::string("zxc");
 
 // positional arguments
 char_reader r0(0, keys[0]);
@@ -4971,38 +3480,18 @@ char_reader r2(keys[2], 2);
 BOOST_TEST_EQ('c', (r2(k2s, true)));
 BOOST_TEST_EQ('z', (r2(k2s, false)));
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • cls is the name of the enclosing -class.
  • -
  • impl is the parenthesized implementation -base class for cls.
  • -
  • tag_namespace is the namespace in which -the keywords used by the constructor resides.
  • -
  • arguments is a list of argument -specifiers, as defined below.
  • +

    The preprocessor.cpp and preprocessor_deduced.cpp test programs +demonstrate proper usage of this macro.

    +

    Macro parameters:

    +
      +
    • cls is the name of the enclosing class.
    • +
    • impl is the parenthesized implementation base class for cls.
    • +
    • tag_namespace is the namespace in which the keywords used by the +constructor resides.
    • +
    • arguments is a list of argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -5024,58 +3513,37 @@ specifier-group1 ::=
         )
     
     specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • argument-name is any valid C++ -identifier.
    • -
    • 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.
    • -
    -

    Note that specifier does not include default-value. It -is up to the delegate constructor in impl to -determine the default value of all optional arguments.

    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • argument-name is any valid C++ identifier.
    • +
    • 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 Constant; 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.
    -
    +

    Note that specifier does not include default-value. It is up to the +delegate constructor in impl to determine the default value of all +optional arguments.

    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
     struct boost_param_params_ ## __LINE__ ## ctor
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -5085,17 +3553,12 @@ typedef boost_param_params_ ## __LINE__ ## ctor
         constructor_parameters ## __LINE__;
     
     template <typename A0, …, typename A ## n>
    -cls(A0&& a0, …, A ## n && a ## n)
    +cls(A0&& a0, …, A ## n && a ## n)
       : impl(
             constructor_parameters ## __LINE__(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         )
     {
    @@ -5104,39 +3567,25 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     template <typename A0, …, typename A ## m>
    -cls(A0&& a0, …, A ## m&& a ## m)
    +cls(A0&& a0, …, A ## m && a ## m)
       : impl(
             constructor_parameters ## __LINE__(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         )
     {
     }
     
    -
    -
-
-

7.7   BOOST_PARAMETER_BASIC_FUNCTION(result, name, -tag_namespace, arguments)

+
+

7.7   BOOST_PARAMETER_BASIC_FUNCTION(result, name, tag_namespace, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -5146,68 +3595,44 @@ arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -5219,85 +3644,63 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same -namespace, which is kw in this case. The -identifiers with leading underscores can be passed to the bracket operator of -args to extract the same argument to which -the corresponding named parameter (without underscores) is bound, as will be -shown later.

-
-BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
+

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same +namespace, which is kw in this case. The identifiers with leading +underscores can be passed to the bracket operator of args to extract the +same argument to which the corresponding named parameter (without underscores) +is bound, as will be shown later.

+
+BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
 

Use the macro as a substitute for a normal function header. Enclose the -return type bool in parentheses. For each -parameter, also enclose the expected value type in parentheses. Since the -value types are mutually exclusive, you can wrap the parameters in a (deduced …) clause. Otherwise, just as with a -normal function, the order in which you specify the parameters determines -their position. However, unlike a normal function, default values must be -specified within the function body. Also within the function body, you must -pass the matching identifier with the leading underscore to the bracket -operator of args to extract the -corresponding argument, but at least this doesn't require std::forward to preserve value categories.

-
+return type bool in parentheses.  For each parameter, also enclose the
+expected value type in parentheses.  Since the value types are mutually
+exclusive, you can wrap the parameters in a (deduced …)
+clause.  Otherwise, just as with a normal function, the order in which you
+specify the parameters determines their position.  However, unlike a normal
+function, default values must be specified within the function body.  Also
+within the function body, you must pass the matching identifier with the
+leading underscore to the bracket operator of args to extract the
+corresponding argument, but at least this doesn't require std::forward to
+preserve value categories.

+
 BOOST_PARAMETER_BASIC_FUNCTION((bool), evaluate, kw,
     (deduced
         (required
-            (lrc, (std::bitset<1>))
-            (lr, (std::bitset<2>))
+            (lrc, (std::bitset<1>))
+            (lr, (std::bitset<2>))
         )
         (optional
-            (rrc, (std::bitset<3>))
-            (rr, (std::bitset<4>))
+            (rrc, (std::bitset<3>))
+            (rr, (std::bitset<4>))
         )
     )
 )
@@ -5325,7 +3728,7 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
 }
 

The following function calls are legal.

-
+
 evaluate(  // positional arguments
     lvalue_const_bitset<0>()
   , lvalue_bitset<1>()
@@ -5353,9 +3756,9 @@ evaluate(  // named arguments
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

Because the parameters were wrapped in a (deduced …) clause, the following function calls are also legal.

-
+

Because the parameters were wrapped in a (deduced …) clause, the following +function calls are also legal.

+
 evaluate(  // deduced arguments
     rvalue_bitset<3>()
   , lvalue_const_bitset<0>()
@@ -5367,36 +3770,19 @@ evaluate(  // deduced arguments
   , lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines 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.
  • +

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

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated forwarding functions.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -5418,75 +3804,41 @@ specifier-group1 ::=
         )
     
     specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • argument-name is any valid C++ -identifier.
    • -
    • 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.
    • -
    -

    Note that specifier does not include default-value. It -is up to the function body to determine the default value of all optional -arguments.

    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • argument-name is any valid C++ identifier.
    • +
    • 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 Constant; 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 result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Note that specifier does not include default-value. It is up to the +function body to determine the default value of all optional arguments.

    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
    -using boost_param_result_ ## __LINE__ ## name = result;
    +using boost_param_result_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename Args>
    @@ -5496,7 +3848,7 @@ struct boost_param_result_ ## __LINE__ ## name
     };
     
     struct boost_param_params_ ## __LINE__ ## name
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -5506,31 +3858,22 @@ 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 ## __LINE__ ## name(Args const&);
    +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()
    -    )
    +result 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 ## __LINE__ ## name(
             boost_param_parameters_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -5538,57 +3881,36 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     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()
    -    )
    +result 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 ## __LINE__ ## name(
             boost_param_parameters_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
     
     template <typename Args>
    -typename boost_param_result_ ## __LINE__ ## name<Args>::type
    -    boost_param_impl ## __LINE__ ## name(Args const& args)
    +typename boost_param_result_ ## __LINE__ ## name<Args>::type
    +    boost_param_impl ## __LINE__ ## name(Args const& args)
     
    -

    Only the ArgumentPack type Args and its object instance args are +

    Only the ArgumentPack type Args and its object instance args are available for use within the function body.

    -
    -
-
-

7.8   BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, -tag_namespace, arguments)

+
+

7.8   BOOST_PARAMETER_BASIC_MEMBER_FUNCTION(result, name, tag_ns, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -5598,68 +3920,44 @@ arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -5671,88 +3969,65 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same -namespace, which is kw in this case. The -identifiers with leading underscores can be passed to the bracket operator of -args to extract the same argument to which -the corresponding named parameter (without underscores) is bound, as will be -shown later.

-
-BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
+

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same +namespace, which is kw in this case. The identifiers with leading +underscores can be passed to the bracket operator of args to extract the +same argument to which the corresponding named parameter (without underscores) +is bound, as will be shown later.

+
+BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
 
-

Use the macro as a substitute for a normal static member function header. Enclose the return type bool in parentheses. For each parameter, also -enclose the expected value type in parentheses. Since the value types are -mutually exclusive, you can wrap the parameters in a (deduced …) clause. Otherwise, just as with a -normal function, the order in which you specify the parameters determines -their position. However, unlike a normal function, default values must be -specified within the function body. Also within the function body, you must -pass the matching identifier with the leading underscore to the bracket -operator of args to extract the -corresponding argument, but at least this doesn't require std::forward to preserve value categories.

-
+

Use the macro as a substitute for a normal static member function +header. Enclose the return type bool in parentheses. For each parameter, +also enclose the expected value type in parentheses. Since the value types +are mutually exclusive, you can wrap the parameters in a (deduced …) +clause. Otherwise, just as with a normal function, the order in which you +specify the parameters determines their position. However, unlike a normal +function, default values must be specified within the function body. Also +within the function body, you must pass the matching identifier with the +leading underscore to the bracket operator of args to extract the +corresponding argument, but at least this doesn't require std::forward to +preserve value categories.

+
 struct B
 {
     BOOST_PARAMETER_BASIC_MEMBER_FUNCTION((bool), static evaluate, kw,
         (deduced
             (required
-                (lrc, (std::bitset<1>))
-                (lr, (std::bitset<2>))
+                (lrc, (std::bitset<1>))
+                (lr, (std::bitset<2>))
             )
             (optional
-                (rrc, (std::bitset<3>))
-                (rr, (std::bitset<4>))
+                (rrc, (std::bitset<3>))
+                (rr, (std::bitset<4>))
             )
         )
     )
@@ -5783,7 +4058,7 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
 };
 

The following function calls are legal.

-
+
 B::evaluate(  // positional arguments
     lvalue_const_bitset<0>()
   , lvalue_bitset<1>()
@@ -5811,9 +4086,9 @@ B::evaluate(  // named arguments
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

Because the parameters were wrapped in a (deduced …) clause, the following function calls are also legal.

-
+

Because the parameters were wrapped in a (deduced …) clause, the following +function calls are also legal.

+
 B::evaluate(  // deduced arguments
     rvalue_bitset<3>()
   , lvalue_const_bitset<0>()
@@ -5825,39 +4100,21 @@ B::evaluate(  // deduced arguments
   , lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines the name of the generated forwarding functions. 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.
  • -
  • tag_namespace is the namespace in which -the keywords used by the function resides.
  • -
  • arguments is a list of argument -specifiers, as defined below.
  • +

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

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated forwarding functions. 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.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -5879,75 +4136,41 @@ specifier-group1 ::=
         )
     
     specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • argument-name is any valid C++ -identifier.
    • -
    • 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.
    • -
    -

    Note that specifier does not include default-value. It -is up to the function body to determine the default value of all optional -arguments.

    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • argument-name is any valid C++ identifier.
    • +
    • 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 Constant; 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 result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Note that specifier does not include default-value. It is up to the +function body to determine the default value of all optional arguments.

    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
    -using boost_param_result_ ## __LINE__ ## name = result;
    +using boost_param_result_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename Args>
    @@ -5957,7 +4180,7 @@ struct boost_param_result_ ## __LINE__ ## name
     };
     
     struct boost_param_params_ ## __LINE__ ## name
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -5967,26 +4190,18 @@ typedef boost_param_params_ ## __LINE__ ## name
         boost_param_parameters_ ## __LINE__ ## name;
     
     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()
    -    )
    +result name(
    +    A0&& a0, …, A ## n&& a ## n
    +  , typename boost_param_parameters_ ## __LINE__ ## name
    +    ::match<A0, …, A ## n>::type
    +    = boost_param_parameters_ ## __LINE__ ## name()
    +)
     {
    -    return this->boost_param_impl ## __LINE__ ## name(
    +    return this->boost_param_impl ## name(
             boost_param_parameters_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -5994,57 +4209,36 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     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()
    -    )
    +result name(
    +    A0&& a0, …, A ## m&& a ## m
    +  , typename boost_param_parameters_ ## __LINE__ ## name
    +    ::match<A0, …, A ## m>::type
    +    = boost_param_parameters_ ## __LINE__ ## name()
    +)
     {
    -    return this->boost_param_impl ## __LINE__ ## name(
    +    return this->boost_param_impl ## name(
             boost_param_parameters_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
     
     template <typename Args>
    -typename boost_param_result_ ## __LINE__ ## name<Args>::type
    -    boost_param_impl ## __LINE__ ## name(Args const& args)
    +typename boost_param_result_ ## __LINE__ ## name<Args>::type
    +    boost_param_impl ## name(Args const& args)
     
    -

    Only the ArgumentPack type Args and its object instance args are +

    Only the ArgumentPack type Args and its object instance args are available for use within the function body.

    -
    -
-
-

7.9   BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(result, -name, tag_namespace, arguments)

+
+

7.9   BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION(result, name, tag_ns, args)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -6054,68 +4248,44 @@ arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -6127,69 +4297,54 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same -namespace, which is kw in this case. The -identifiers with leading underscores can be passed to the bracket operator of -args to extract the same argument to which -the corresponding named parameter (without underscores) is bound, as will b -shown later.

-
-BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
+

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same +namespace, which is kw in this case. The identifiers with leading +underscores can be passed to the bracket operator of args to extract the +same argument to which the corresponding named parameter (without underscores) +is bound, as will be shown later.

+
+BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
 
-

Use the macro as a substitute for a normal const member function header. Enclose the return type bool in parentheses. For each parameter, also -enclose the expected value type in parentheses. Since the value types are -mutually exclusive, you can wrap the parameters in a (deduced …) clause. Otherwise, just as with a -normal function, the order in which you specify the parameters determines -their position. However, unlike a normal function, default values must be -specified within the function body. Also within the function body, you must -pass the matching identifier with the leading underscore to the bracket -operator of args to extract the -corresponding argument, but at least this doesn't require std::forward to preserve value categories.

-
+

Use the macro as a substitute for a normal const member function +header. Enclose the return type bool in parentheses. For each parameter, +also enclose the expected value type in parentheses. Since the value types +are mutually exclusive, you can wrap the parameters in a (deduced …) +clause. Otherwise, just as with a normal function, the order in which you +specify the parameters determines their position. However, unlike a normal +function, default values must be specified within the function body. Also +within the function body, you must pass the matching identifier with the +leading underscore to the bracket operator of args to extract the +corresponding argument, but at least this doesn't require std::forward to +preserve value categories.

+
 struct B
 {
     B()
@@ -6199,20 +4354,12 @@ struct B
     BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION((bool), evaluate, kw,
         (deduced
             (required
-                (lrc, (std::bitset<1>))
-                (lr, (std::bitset<2>))
+                (lrc, (std::bitset<1>))
+                (lr, (std::bitset<2>))
             )
             (optional
-                (rrc, (std::bitset<3>))
-                (rr, (std::bitset<4>))
+                (rrc, (std::bitset<3>))
+                (rr, (std::bitset<4>))
             )
         )
     )
@@ -6243,7 +4390,7 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
 };
 

The following function calls are legal.

-
+
 B const b = B();
 b.evaluate(  // positional arguments
     lvalue_const_bitset<0>()
@@ -6272,9 +4419,9 @@ b.evaluate(  // named arguments
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

Because the parameters were wrapped in a (deduced …) clause, the following function calls are also legal.

-
+

Because the parameters were wrapped in a (deduced …) clause, the following +function calls are also legal.

+
 b.evaluate(  // deduced arguments
     rvalue_bitset<3>()
   , lvalue_const_bitset<0>()
@@ -6286,36 +4433,19 @@ b.evaluate(  // deduced arguments
   , lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines 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.
  • +

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

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated forwarding functions.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -6337,75 +4467,41 @@ specifier-group1 ::=
         )
     
     specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • argument-name is any valid C++ -identifier.
    • -
    • 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.
    • -
    -

    Note that specifier does not include default-value. It -is up to the function body to determine the default value of all optional -arguments.

    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • argument-name is any valid C++ identifier.
    • +
    • 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 Constant; 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 result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Note that specifier does not include default-value. It is up to the +function body to determine the default value of all optional arguments.

    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
    -using boost_param_result_const_ ## __LINE__ ## name = result;
    +using boost_param_result_const_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename Args>
    @@ -6415,7 +4511,7 @@ struct boost_param_result_const_ ## __LINE__ ## name
     };
     
     struct boost_param_params_const_ ## __LINE__ ## name
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -6425,27 +4521,18 @@ typedef boost_param_params_const_ ## __LINE__ ## name
         boost_param_parameters_const_ ## __LINE__ ## name;
     
     template <typename A0, …, typename A ## n>
    -result type
    -    name(
    -        A0&& a0, …, A ## n && a ## n
    -      , typename boost_param_parameters_const_ ## __LINE__ ## name::match<
    -            A0, …, A ## n
    -        >::type = boost_param_parameters_const_ ## __LINE__ ## name()
    -    ) const
    +result name(
    +    A0&& a0, …, A ## n&& a ## n
    +  , typename boost_param_parameters_const_ ## __LINE__ ## name
    +    ::match<A0, …, A ## n>::type
    +    = boost_param_parameters_const_ ## __LINE__ ## name()
    +) const
     {
    -    return this->boost_param_impl_const ## __LINE__ ## name(
    +    return this->boost_param_impl_const ## __LINE__ ## name(
             boost_param_parameters_const_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -6453,58 +4540,36 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     template <typename A0, …, typename A ## m>
    -result type
    -    name(
    -        A0&& a0, …, A ## m && a ## m
    -      , typename boost_param_parameters_const_ ## __LINE__ ## name::match<
    -            A0, …, A ## m
    -        >::type = boost_param_parameters_const_ ## __LINE__ ## name()
    -    ) const
    +result name(
    +    A0&& a0, …, A ## m&& a ## m
    +  , typename boost_param_parameters_const_ ## __LINE__ ## name
    +    ::match<A0, …, A ## m>::type
    +    = boost_param_parameters_const_ ## __LINE__ ## name()
    +) const
     {
    -    return this->boost_param_impl_const ## __LINE__ ## name(
    +    return this->boost_param_impl_const ## __LINE__ ## name(
             boost_param_parameters_const_ ## __LINE__ ## name()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
     
     template <typename Args>
    -typename boost_param_result_const_ ## __LINE__ ## name<Args>::type
    -    boost_param_impl_const ## __LINE__ ## name(Args const& args) const
    +typename boost_param_result_const_ ## __LINE__ ## name<Args>::type
    +    boost_param_impl_const ## __LINE__ ## name(Args const& args) const
     
    -

    Only the ArgumentPack type Args and its object instance args are +

    Only the ArgumentPack type Args and its object instance args are available for use within the function body.

    -
    -
-
-

7.10   BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR(result, -tag_ns, arguments)

+
+

7.10   BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR(result, tag_ns, arguments)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -6514,29 +4579,24 @@ composed arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - -

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same + + +

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same namespace, which is tag by default.

-
-BOOST_PARAMETER_NAME(y)
-BOOST_PARAMETER_NAME(z)
+
+BOOST_PARAMETER_NAME(y)
+BOOST_PARAMETER_NAME(z)
 

Use the macro as a substitute for a normal function call operator header. Enclose the return type in parentheses. For each parameter, also enclose the expected value type in parentheses. Since the value types are -mutually exclusive, you can wrap the parameters in a (deduced …) clause. This is especially useful -when implementing multiple Boost.Parameter-enabled function call operator -overloads.

-
+mutually exclusive, you can wrap the parameters in a (deduced …)
+clause.  This is especially useful when implementing multiple
+Boost.Parameter-enabled function call operator overloads.

+
 class char_reader
 {
     int index;
@@ -6560,16 +4620,11 @@ class char_reader
         this->key = args[_z];
     }
 
-    BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR((char), tag,
+    BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR((char), tag,
         (deduced
             (required
                 (y, (bool))
-                (z, (std::map<char const*,std::string>))
+                (z, (std::map<char const*, std::string>))
             )
         )
     )
@@ -6582,22 +4637,12 @@ href="http://en.cppreference.com/w/cpp/string/basic_string">string>))
 

As with regular argument-dependent lookup, the value types of the arguments passed in determine which function call operator overload gets invoked.

-
-char const* keys[] = {"foo", "bar", "baz"};
-std::map<char const*,std::string> k2s;
-k2s[keys[0]] = std::string>("qux");
-k2s[keys[1]] = std::string>("wmb");
-k2s[keys[2]] = std::string>("zxc");
+
+char const* keys[] = {"foo", "bar", "baz"};
+std::map<char const*, std::string> k2s;
+k2s[keys[0]] = std::string("qux");
+k2s[keys[1]] = std::string("wmb");
+k2s[keys[2]] = std::string("zxc");
 char_reader r(keys[0]);
 
 // positional arguments
@@ -6614,34 +4659,17 @@ r(keys[2], 2);
 BOOST_TEST_EQ('c', (r(k2s, true)));
 BOOST_TEST_EQ('z', (r(k2s, false)));
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function call operator.
  • -
  • tag_namespace is the namespace in which -the keywords used by the function call operator resides.
  • -
  • arguments is a list of argument -specifiers, as defined below.
  • +

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

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function call operator.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function call operator resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -6663,72 +4691,39 @@ specifier-group1 ::=
         )
     
     specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • argument-name is any valid C++ -identifier.
    • -
    • 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.
    • -
    -

    Note that specifier does not include default-value. It -is up to the function body to determine the default value of all optional -arguments.

    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • argument-name is any valid C++ identifier.
    • +
    • 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 Constant; 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 result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Note that specifier does not include default-value. It is up to the +function body to determine the default value of all optional arguments.

    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
     using boost_param_result_ ## __LINE__ ## operator = result;
     
    @@ -6740,7 +4735,7 @@ struct boost_param_result_ ## __LINE__ ## operator
     };
     
     struct boost_param_params_ ## __LINE__ ## operator
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -6750,24 +4745,18 @@ typedef boost_param_params_ ## __LINE__ ## operator
         boost_param_parameters_ ## __LINE__ ## operator;
     
     template <typename A0, …, typename A ## n>
    -result type
    -    operator()(
    -        A0&& a0, …, A ## n && a ## n
    -      , typename boost_param_parameters_ ## __LINE__ ## operator
    -        ::match<A0, …, A ## n>::type
    -        = boost_param_parameters_ ## __LINE__ ## operator()
    -    )
    +result operator()(
    +    A0&& a0, …, A ## n&& a ## n
    +  , typename boost_param_parameters_ ## __LINE__ ## operator::match<
    +        A0, …, A ## n
    +    >::type = boost_param_parameters_ ## __LINE__ ## operator()
    +)
     {
         return this->boost_param_impl ## __LINE__ ## operator(
             boost_param_parameters_ ## __LINE__ ## operator()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -6775,24 +4764,18 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     template <typename A0, …, typename A ## m>
    -result type
    -    operator()(
    -        A0&& a0, …, A ## m && a ## m
    -      , typename boost_param_parameters_ ## __LINE__ ## operator
    -        ::match<A0, …, A ## m>::type
    -        = boost_param_parameters_ ## __LINE__ ## operator()
    -    )
    +result operator()(
    +    A0&& a0, …, A ## m&& a ## m
    +  , typename boost_param_parameters_ ## __LINE__ ## operator::match<
    +        A0, …, A ## m
    +    >::type = boost_param_parameters_ ## __LINE__ ## operator()
    +)
     {
         return this->boost_param_impl ## __LINE__ ## operator(
             boost_param_parameters_ ## __LINE__ ## operator()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
    @@ -6801,24 +4784,16 @@ template <typename Args>
     typename boost_param_result_ ## __LINE__ ## operator<Args>::type
         boost_param_impl ## __LINE__ ## operator(Args const& args)
     
    -
    -
    +

    Only the ArgumentPack type Args and its object instance args are +available for use within the function call operator body.

-
-

7.11   BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, -args)

+
+

7.11   BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR(result, tag_ns, args)

- - - +
Defined in:boost/parameter/preprocessor.hpp
Defined in:boost/parameter/preprocessor.hpp
@@ -6828,68 +4803,44 @@ composed arguments, named arguments, and deduced arguments.

- -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -6901,69 +4852,54 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Define the named parameters that will comprise the argument specification -that this macro will use. Ensure that all their tag types are in the same -namespace, which is kw in this case. The -identifiers with leading underscores can be passed to the bracket operator of -args to extract the same argument to which -the corresponding named parameter (without underscores) is bound, as will be -shown later.

-
-BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
+

Define the named parameters that will comprise the argument specification that +this macro will use. Ensure that all their tag types are in the same +namespace, which is kw in this case. The identifiers with leading +underscores can be passed to the bracket operator of args to extract the +same argument to which the corresponding named parameter (without underscores) +is bound, as will be shown later.

+
+BOOST_PARAMETER_NAME((_lrc, kw) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw) consume(rr))
 
-

Use the macro as a substitute for a normal const function call operator header. Enclose the return type bool in parentheses. For each parameter, also -enclose the expected value type in parentheses. Since the value types are -mutually exclusive, you can wrap the parameters in a (deduced …) clause. Otherwise, just as with a -normal function, the order in which you specify the parameters determines -their position. However, unlike a normal function, default values must be -specified within the function body. Also within the function body, you must -pass the matching identifier with the leading underscore to the bracket -operator of args to extract the -corresponding argument, but at least this doesn't require std::forward to preserve value categories.

-
+

Use the macro as a substitute for a normal const function call operator +header. Enclose the return type bool in parentheses. For each parameter, +also enclose the expected value type in parentheses. Since the value types +are mutually exclusive, you can wrap the parameters in a (deduced …) +clause. Otherwise, just as with a normal function, the order in which you +specify the parameters determines their position. However, unlike a normal +function, default values must be specified within the function body. Also +within the function body, you must pass the matching identifier with the +leading underscore to the bracket operator of args to extract the +corresponding argument, but at least this doesn't require std::forward to +preserve value categories.

+
 struct B
 {
     B()
@@ -6973,20 +4909,12 @@ struct B
     BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR((bool), kw,
         (deduced
             (required
-                (lrc, (std::bitset<1>))
-                (lr, (std::bitset<2>))
+                (lrc, (std::bitset<1>))
+                (lr, (std::bitset<2>))
             )
             (optional
-                (rrc, (std::bitset<3>))
-                (rr, (std::bitset<4>))
+                (rrc, (std::bitset<3>))
+                (rr, (std::bitset<4>))
             )
         )
     )
@@ -7017,7 +4945,7 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
 };
 

The following function calls are legal.

-
+
 B const b = B();
 b(  // positional arguments
     lvalue_const_bitset<0>()
@@ -7046,9 +4974,9 @@ b(  // named arguments
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

Because the parameters were wrapped in a (deduced …) clause, the following function calls are also legal.

-
+

Because the parameters were wrapped in a (deduced …) clause, the following +function calls are also legal.

+
 b(  // deduced arguments
     rvalue_bitset<3>()
   , lvalue_const_bitset<0>()
@@ -7060,34 +4988,17 @@ b(  // deduced arguments
   , lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function call operator.
  • -
  • tag_namespace is the namespace in which -the keywords used by the function call operator resides.
  • -
  • arguments is a list of argument -specifiers, as defined below.
  • +

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

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function call operator.
    • +
    • tag_namespace is the namespace in which the keywords used by the +function call operator resides.
    • +
    • arguments is a Boost.Preprocessor sequence of +argument-specifiers, as defined below.
    - - - -Argument specifiers syntax: - - -  - -
    +

    Argument specifiers syntax:

    +
     argument-specifiers ::= specifier-group0 {specifier-group0}
     
     specifier-group0 ::= specifier-group1 |
    @@ -7109,75 +5020,41 @@ specifier-group1 ::=
         )
     
     specifier ::=
    -    '(' argument-name ',' restriction ')'
    +    '(' argument-name ',' restriction ')'
     
     restriction ::=
    -    ( '*' '(' mfc ')' ) |
    -    ( '(' typename ')' ) |
    +    ( '*' '(' mfc ')' ) |
    +    ( '(' type-name ')' ) |
         '*'
     
    -
      -
    • argument-name is any valid C++ -identifier.
    • -
    • 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.
    • -
    -

    Note that specifier does not include default-value. It -is up to the function body to determine the default value of all optional -arguments.

    - - - - -
    -
    Approximate expansion:
    -
    -

    Where:

      -
    • n denotes the minimum arity, as -determined from arguments.
    • -
    • m denotes the maximum arity, as -determined from arguments.
    • +
    • argument-name is any valid C++ identifier.
    • +
    • 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 Constant; 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 result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Note that specifier does not include default-value. It is up to the +function body to determine the default value of all optional arguments.

    +

    Approximate expansion:

    +

    Where:

    +
      +
    • n denotes the minimum arity, as determined from arguments.
    • +
    • m denotes the maximum arity, as determined from arguments.
    • +
    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename Args>
    -using boost_param_result_const_ ## __LINE__ ## operator = result;
    +using boost_param_result_const_ ## __LINE__ ## operator = result;
     
     // If result is a simple return type:
     template <typename Args>
    @@ -7187,7 +5064,7 @@ struct boost_param_result_const_ ## __LINE__ ## operator
     };
     
     struct boost_param_params_const_ ## __LINE__ ## operator
    -  : parameters<
    +  : parameters<
             list of parameter specifications, based on arguments
         >
     {
    @@ -7197,24 +5074,18 @@ typedef boost_param_params_const_ ## __LINE__ ## operator
         boost_param_parameters_const_ ## __LINE__ ## operator;
     
     template <typename A0, …, typename A ## n>
    -result type
    -    operator()(
    -        A0&& a0, …, A ## n && a ## n
    -      , typename boost_param_parameters_const_ ## __LINE__ ## operator
    -        ::match<A0, …, A ## n>::type
    -        = boost_param_parameters_const_ ## __LINE__ ## operator()
    -    ) const
    +result operator()(
    +    A0&& a0, …, A ## n&& a ## n
    +  , typename boost_param_parameters_const_ ## __LINE__ ## operator
    +    ::match<A0, …, A ## n>::type
    +    = boost_param_parameters_const_ ## __LINE__ ## operator()
    +) const
     {
         return this->boost_param_impl_const ## __LINE__ ## operator(
             boost_param_parameters_const_ ## __LINE__ ## operator()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## n>(a ## n)
    +          , std::forward<A ## n>(a ## n)
             )
         );
     }
    @@ -7222,24 +5093,18 @@ href="http://en.cppreference.com/w/cpp/utility/forward"
     
     
     template <typename A0, …, typename A ## m>
    -result type
    -    operator()(
    -        A0&& a0, …, A ## m && a ## m
    -      , typename boost_param_parameters_const_ ## __LINE__ ## operator
    -        ::match<A0, …, A ## m>::type
    -        = boost_param_parameters_const_ ## __LINE__ ## operator()
    -    ) const
    +result operator()(
    +    A0&& a0, …, A ## m&& a ## m
    +  , typename boost_param_parameters_const_ ## __LINE__ ## operator
    +    ::match<A0, …, A ## m>::type
    +    = boost_param_parameters_const_ ## __LINE__ ## operator()
    +) const
     {
         return this->boost_param_impl_const ## __LINE__ ## operator(
             boost_param_parameters_const_ ## __LINE__ ## operator()(
    -            std::forward<A0>(a0)
    +            std::forward<A0>(a0)
               , …
    -          , std::forward<A ## m>(a ## m)
    +          , std::forward<A ## m>(a ## m)
             )
         );
     }
    @@ -7248,22 +5113,16 @@ template <typename Args>
     typename boost_param_result_const_ ## __LINE__ ## operator<Args>::type
         boost_param_impl_const ## __LINE__ ## operator(Args const& args) const
     
    -
    -
    +

    Only the ArgumentPack type Args and its object instance args are +available for use within the function call operator body.

-

7.12   BOOST_PARAMETER_NO_SPEC_FUNCTION(result, -name)

+

7.12   BOOST_PARAMETER_NO_SPEC_FUNCTION(result, name)

- - - +
Defined in:boost/parameter/preprocessor_no_spec.hpp
Defined in:boost/parameter/preprocessor_no_spec.hpp
@@ -7272,68 +5131,44 @@ href="../../../../boost/parameter/preprocessor_no_spec.hpp" - -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -7345,33 +5180,25 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
@@ -7379,19 +5206,15 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
 

Named parameters are required when invoking the function; however, none of their tags need to be in the same namespace.

-
-BOOST_PARAMETER_NAME((_lrc, kw0) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw1) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw2) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw3) consume(rr))
+
+BOOST_PARAMETER_NAME((_lrc, kw0) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw1) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw2) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw3) consume(rr))
 

Use the macro as a substitute for a variadic function header. Enclose the return type bool in parentheses.

-
+
 BOOST_PARAMETER_NO_SPEC_FUNCTION((bool), evaluate)
 {
     BOOST_TEST_EQ(
@@ -7405,19 +5228,19 @@ BOOST_PARAMETER_NO_SPEC_FUNCTION((bool), evaluate)
     BOOST_TEST_EQ(
         passed_by_rvalue_reference_to_const
       , U::evaluate_category<2>(
-            args[_rrc0 | rvalue_const_bitset<2>()]
+            args[_rrc | rvalue_const_bitset<2>()]
         )
     );
     BOOST_TEST_EQ(
         passed_by_rvalue_reference
-      , U::evaluate_category<3>(args[_rr0 | rvalue_bitset<3>()])
+      , U::evaluate_category<3>(args[_rr | rvalue_bitset<3>()])
     );
 
     return true;
 }
 

To invoke the function, bind all its arguments to named parameters.

-
+
 evaluate(
     _rr0 = rvalue_bitset<3>()
   , _lrc0 = lvalue_const_bitset<0>()
@@ -7429,58 +5252,25 @@ evaluate(
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines the name of the generated implementation function.
  • +

    The preprocessor_eval_cat_no_spec.cpp test program demonstrates proper usage of +this macro.

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated implementation function.
    - - - -Argument specifiers syntax: - - -  -None. - - - -
    -
    Approximate expansion:
    -
    -
    -// If result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Argument specifiers syntax:

    +

    None.

    +

    Approximate expansion:

    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename TaggedArg0, typename ...TaggedArgs>
    -using boost_param_no_spec_result_ ## __LINE__ ## name = result;
    +using boost_param_no_spec_result_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename TaggedArg0, typename ...TaggedArgs>
    @@ -7497,30 +5287,24 @@ ResultType
         );
     
     template <typename TaggedArg0, typename ...TaggedArgs>
    -inline typename boost::lazy_enable_if<
    -    are_tagged_arguments<TaggedArg0,TaggedArgs...>
    +inline typename boost::lazy_enable_if<
    +    are_tagged_arguments<TaggedArg0,TaggedArgs...>
       , boost_param_no_spec_result_ ## __LINE__ ## name<
             TaggedArg0
           , TaggedArgs...
         >
     >::type
    -    name(TaggedArg0 const& arg0, TaggedArgs const&... args)
    +    name(TaggedArg0 const& arg0, TaggedArgs const&... args)
     {
         return boost_param_no_spec_impl ## __LINE__ ## name(
             static_cast<
                 typename
    -            boost_param_no_spec_result_ ## __LINE__ ## name<
    +            boost_param_no_spec_result_ ## __LINE__ ## name<
                     TaggedArg0
                   , TaggedArgs...
                 >::type(*)()
    -        >(nullptr)
    -      , compose(arg0, args...)
    +        >(std::nullptr)
    +      , compose(arg0, args...)
         );
     }
     
    @@ -7531,26 +5315,16 @@ ResultType
           , Args const& args
         )
     
    -

    Only the ArgumentPack type Args and its object instance args are +

    Only the ArgumentPack type Args and its object instance args are available for use within the function body.

    -
    -
-

7.13   BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION(result, -name)

+

7.13   BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION(result, name)

- - - +
Defined in:boost/parameter/preprocessor_no_spec.hpp
Defined in:boost/parameter/preprocessor_no_spec.hpp
@@ -7559,17 +5333,15 @@ href="../../../../boost/parameter/preprocessor_no_spec.hpp" - -Example usage: +Example usage: - -  - -

When designing a front-end class template whose back-end is configurable -via parameterized inheritance, it can be useful to omit argument specifiers -from a named-parameter member function so that the delegate member functions -of the back-end classes can enforce their own specifications.

-
+
+
+

When designing a front-end class template whose back-end is configurable via +parameterized inheritance, it can be useful to omit argument specifiers from +a named-parameter member function so that the delegate member functions of the +back-end classes can enforce their own specifications.

+
 template <typename B>
 struct frontend : B
 {
@@ -7583,20 +5355,17 @@ struct frontend : B
     }
 };
 
-

Named parameters are required when invoking the member function; however, -none of their tags need to be in the same namespace.

-
-BOOST_PARAMETER_NAME(a0)
-BOOST_PARAMETER_NAME(a1)
-BOOST_PARAMETER_NAME(a2)
+

Named parameters are required when invoking the member function; however, none +of their tags need to be in the same namespace.

+
+BOOST_PARAMETER_NAME(a0)
+BOOST_PARAMETER_NAME(a1)
+BOOST_PARAMETER_NAME(a2)
 

For this example, each of the back-end class templates requires its own parameter to be present in the argument pack. In practice, such parameters should be optional, with default values.

-
+
 template <typename T>
 class backend0
 {
@@ -7668,12 +5437,11 @@ class backend2 : public B
     }
 };
 
-

This example shows that while backend0 -must always be the root base class template and that frontend must always be the most derived class -template, the other back-ends can be chained together in different orders.

-
-char const* p = "foo";
+

This example shows that while backend0 must always be the root base class +template and that frontend must always be the most derived class template, +the other back-ends can be chained together in different orders.

+
+char const* p = "foo";
 frontend<
     backend2<backend1<backend0<char const*>, char>, int>
 > composed_obj0;
@@ -7686,63 +5454,27 @@ BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
 
-

The test/parameterized_inheritance.cpp and test/preprocessor_eval_cat_no_spec.cpp test programs demonstrate proper -usage of this macro.

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines the name of the generated implementation function. 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.
  • +

    The parameterized_inheritance.cpp and preprocessor_eval_cat_no_spec.cpp test +programs demonstrate proper usage of this macro.

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated implementation function. 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.
    - - - -Argument specifiers syntax: - - -  -None. - - - -
    -
    Approximate expansion:
    -
    -
    -// If result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Argument specifiers syntax:

    +

    None.

    +

    Approximate expansion:

    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename TaggedArg0, typename ...TaggedArgs>
    -using boost_param_no_spec_result_ ## __LINE__ ## name = result;
    +using boost_param_no_spec_result_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename TaggedArg0, typename ...TaggedArgs>
    @@ -7752,31 +5484,24 @@ struct boost_param_no_spec_result_ ## __LINE__ ## name
     };
     
     template <typename TaggedArg0, typename ...TaggedArgs>
    -inline typename boost::lazy_enable_if<
    -    are_tagged_arguments<TaggedArg0,TaggedArgs...>
    +inline typename boost::lazy_enable_if<
    +    are_tagged_arguments<TaggedArg0,TaggedArgs...>
       , boost_param_no_spec_result_ ## __LINE__ ## name<
             TaggedArg0
           , TaggedArgs...
         >
     >::type
    -    name(TaggedArg0 const& arg0, TaggedArgs const&... args)
    +    name(TaggedArg0 const& arg0, TaggedArgs const&... args)
     {
    -    return this->boost_param_no_spec_impl ## __LINE__ ## name(
    +    return this->boost_param_no_spec_impl ## __LINE__ ## name(
             static_cast<
                 typename
    -            boost_param_no_spec_result_ ## __LINE__ ## name<
    +            boost_param_no_spec_result_ ## __LINE__ ## name<
                     TaggedArg0
                   , TaggedArgs...
                 >::type(*)()
    -        >(nullptr)
    -      , compose(arg0, args...)
    +        >(std::nullptr)
    +      , compose(arg0, args...)
         );
     }
     
    @@ -7787,26 +5512,16 @@ ResultType
           , Args const& args
         )
     
    -

    Only the ArgumentPack type Args and its object instance args are +

    Only the ArgumentPack type Args and its object instance args are available for use within the function body.

    -
    -
-
-

7.14   BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION(result, -name)

+
+

7.14   BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION(result, name)

- - - +
Defined in:boost/parameter/preprocessor_no_spec.hpp
Defined in:boost/parameter/preprocessor_no_spec.hpp
@@ -7815,68 +5530,44 @@ href="../../../../boost/parameter/preprocessor_no_spec.hpp" - -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -7888,55 +5579,42 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Named parameters are required when invoking the member function; however, -none of their tags need to be in the same namespace.

-
-BOOST_PARAMETER_NAME((_lrc, kw0) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw1) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw2) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw3) consume(rr))
+

Named parameters are required when invoking the member function; however, none +of their tags need to be in the same namespace.

+
+BOOST_PARAMETER_NAME((_lrc, kw0) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw1) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw2) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw3) consume(rr))
 

Use the macro as a substitute for a variadic function header. Enclose the -return type bool in parentheses. The macro -will qualify the function with the const -keyword.

-
+return type bool in parentheses.  The macro will qualify the function with
+the const keyword.

+
 struct D
 {
     D()
@@ -7956,13 +5634,13 @@ struct D
         BOOST_TEST_EQ(
             passed_by_rvalue_reference_to_const
           , U::evaluate_category<2>(
-                args[_rrc0 | rvalue_const_bitset<2>()]
+                args[_rrc | rvalue_const_bitset<2>()]
             )
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference
           , U::evaluate_category<3>(
-                args[_rr0 | rvalue_bitset<3>()]
+                args[_rr | rvalue_bitset<3>()]
             )
         );
 
@@ -7970,9 +5648,8 @@ struct D
     }
 };
 
-

To invoke the member function, bind all its arguments to named -parameters.

-
+

To invoke the member function, bind all its arguments to named parameters.

+
 D const d = D();
 d.evaluate_m(
     _rr0 = rvalue_bitset<3>()
@@ -7985,58 +5662,25 @@ d.evaluate_m(
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • result is the parenthesized return type -of the function.
  • -
  • name is the base name of the function; -it determines the name of the generated implementation function.
  • +

    The preprocessor_eval_cat_no_spec.cpp test program demonstrates proper usage of +this macro.

    +

    Macro parameters:

    +
      +
    • result is the parenthesized return type of the function.
    • +
    • name is the base name of the function; it determines the name of the +generated implementation function.
    - - - -Argument specifiers syntax: - - -  -None. - - - -
    -
    Approximate expansion:
    -
    -
    -// If result is a template instantiation of enable_if, enable_if_c,
    -// lazy_enable_if, lazy_enable_if_c, disable_if, disable_if_c,
    -// lazy_disable_if, lazy_disable_if_c, or std::enable_if:
    +

    Argument specifiers syntax:

    +

    None.

    +

    Approximate expansion:

    +
    +// If result is a template instantiation of boost::enable_if,
    +// boost::enable_if_c, boost::lazy_enable_if,
    +// boost::lazy_enable_if_c, boost::disable_if, boost::disable_if_c,
    +// boost::lazy_disable_if, boost::lazy_disable_if_c, or
    +// std::enable_if:
     template <typename TaggedArg0, typename ...TaggedArgs>
    -using boost_param_no_spec_result_const_ ## __LINE__ ## name = result;
    +using boost_param_no_spec_result_const_ ## __LINE__ ## name = result;
     
     // If result is a simple return type:
     template <typename TaggedArg0, typename ...TaggedArgs>
    @@ -8046,32 +5690,24 @@ struct boost_param_no_spec_result_const_ ## __LINE__ ## name
     };
     
     template <typename TaggedArg0, typename ...TaggedArgs>
    -inline typename boost::lazy_enable_if<
    -    are_tagged_arguments<TaggedArg0,TaggedArgs...>
    +inline typename boost::lazy_enable_if<
    +    are_tagged_arguments<TaggedArg0,TaggedArgs...>
       , boost_param_no_spec_result_const_ ## __LINE__ ## name<
             TaggedArg0
           , TaggedArgs...
         >
     >::type
    -    name(TaggedArg0 const& arg0, TaggedArgs const&... args) const
    +    name(TaggedArg0 const& arg0, TaggedArgs const&... args) const
     {
    -    return this->boost_param_no_spec_impl_const ## __LINE__ ## name(
    +    return this->boost_param_no_spec_impl_const ## __LINE__ ## name(
             static_cast<
                 typename
    -            boost_param_no_spec_result_const_ ## __LINE__ ## name<
    +            boost_param_no_spec_result_const_ ## __LINE__ ## name<
                     TaggedArg0
                   , TaggedArgs...
                 >::type(*)()
    -        >(nullptr)
    -      , compose(arg0, args...)
    +        >(std::nullptr)
    +      , compose(arg0, args...)
         );
     }
     
    @@ -8082,26 +5718,16 @@ ResultType
           , Args const& args
         ) const
     
    -

    Only the ArgumentPack type Args and its object instance args are +

    Only the ArgumentPack type Args and its object instance args are available for use within the function body.

    -
    -
-
-

7.15   BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR(result)

+
+

7.15   BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR(result)

- - - +
Defined in:boost/parameter/preprocessor_no_spec.hpp
Defined in:boost/parameter/preprocessor_no_spec.hpp
@@ -8110,17 +5736,15 @@ href="../../../../boost/parameter/preprocessor_no_spec.hpp" - -Example usage: +Example usage: - -  - -

When designing a front-end class template whose back-end is configurable -via parameterized inheritance, it can be useful to omit argument specifiers -from a named-parameter function call operator so that the delegate member -functions of the back-end classes can enforce their own specifications.

-
+
+
+

When designing a front-end class template whose back-end is configurable via +parameterized inheritance, it can be useful to omit argument specifiers from +a named-parameter function call operator so that the delegate member functions +of the back-end classes can enforce their own specifications.

+
 template <typename B>
 struct frontend : B
 {
@@ -8136,18 +5760,15 @@ struct frontend : B
 

Named parameters are required when invoking the function call operator; however, none of their tags need to be in the same namespace.

-
-BOOST_PARAMETER_NAME(a0)
-BOOST_PARAMETER_NAME(a1)
-BOOST_PARAMETER_NAME(a2)
+
+BOOST_PARAMETER_NAME(a0)
+BOOST_PARAMETER_NAME(a1)
+BOOST_PARAMETER_NAME(a2)
 

For this example, each of the back-end class templates requires its own parameter to be present in the argument pack. In practice, such parameters should be optional, with default values.

-
+
 template <typename T>
 class backend0
 {
@@ -8219,12 +5840,11 @@ class backend2 : public B
     }
 };
 
-

This example shows that while backend0 -must always be the root base class template and that frontend must always be the most derived class -template, the other back-ends can be chained together in different orders.

-
-char const* p = "foo";
+

This example shows that while backend0 must always be the root base class +template and that frontend must always be the most derived class template, +the other back-ends can be chained together in different orders.

+
+char const* p = "foo";
 frontend<
     backend2<backend1<backend0<char const*>, char>, int>
 > composed_obj0;
@@ -8237,58 +5857,23 @@ BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
 
-

The test/parameterized_inheritance.cpp and test/preprocessor_eval_cat_no_spec.cpp test programs demonstrate proper -usage of this macro.

- - - -Macro parameters: - - -  - -
-
-

7.16   BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR(result)

+
+

7.16   BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR(result)

- - - +
Defined in:boost/parameter/preprocessor_no_spec.hpp
Defined in:boost/parameter/preprocessor_no_spec.hpp
@@ -8358,68 +5929,44 @@ href="../../../../boost/parameter/preprocessor_no_spec.hpp" - -Example usage: +Example usage: - -  - + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -8431,33 +5978,25 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
@@ -8465,21 +6004,16 @@ href="http://en.cppreference.com/w/cpp/utility/bitset"
 

Named parameters are required when invoking the function call operator; however, none of their tags need to be in the same namespace.

-
-BOOST_PARAMETER_NAME((_lrc, kw0) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw1) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw2) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw3) consume(rr))
+
+BOOST_PARAMETER_NAME((_lrc, kw0) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw1) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw2) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw3) consume(rr))
 

Use the macro as a substitute for a variadic function call operator -header. Enclose the return type bool in -parentheses. The macro will qualify the function with the const keyword.

-
+header.  Enclose the return type bool in parentheses.  The macro will
+qualify the function with the const keyword.

+
 struct D
 {
     D()
@@ -8499,13 +6033,13 @@ struct D
         BOOST_TEST_EQ(
             passed_by_rvalue_reference_to_const
           , U::evaluate_category<2>(
-                args[_rrc0 | rvalue_const_bitset<2>()]
+                args[_rrc | rvalue_const_bitset<2>()]
             )
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference
           , U::evaluate_category<3>(
-                args[_rr0 | rvalue_bitset<3>()]
+                args[_rr | rvalue_bitset<3>()]
             )
         );
 
@@ -8515,7 +6049,7 @@ struct D
 

To invoke the function call operator, bind all its arguments to named parameters.

-
+
 D const d = D();
 d(
     _rr0 = rvalue_bitset<3>()
@@ -8528,56 +6062,23 @@ d(
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
-

7.17   BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(cls, -impl)

+

7.17   BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(cls, impl)

- - - +
Defined in:boost/parameter/preprocessor_no_spec.hpp
Defined in:boost/parameter/preprocessor_no_spec.hpp
@@ -8650,37 +6137,32 @@ href="../../../../boost/parameter/preprocessor_no_spec.hpp" - -Example usage: +Example usage: - -  - -

When designing a front-end class template whose back-end is configurable -via parameterized inheritance, it can be useful to omit argument specifiers -from a named-parameter constructor so that the delegate constructors of the + + +

When designing a front-end class template whose back-end is configurable via +parameterized inheritance, it can be useful to omit argument specifiers from +a named-parameter constructor so that the delegate constructors of the back-end classes can enforce their own specifications.

-
+
 template <typename B>
 struct frontend : B
 {
     BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(frontend, (B))
 };
 
-

Named parameters are required when invoking the constructor; however, none -of their tags need to be in the same namespace.

-
-BOOST_PARAMETER_NAME(a0)
-BOOST_PARAMETER_NAME(a1)
-BOOST_PARAMETER_NAME(a2)
+

Named parameters are required when invoking the constructor; however, none of +their tags need to be in the same namespace.

+
+BOOST_PARAMETER_NAME(a0)
+BOOST_PARAMETER_NAME(a1)
+BOOST_PARAMETER_NAME(a2)
 

For this example, each of the back-end class templates requires its own parameter to be present in the argument pack. In practice, such parameters should be optional, with default values.

-
+
 struct _enabler
 {
 };
@@ -8694,10 +6176,8 @@ class backend0
     template <typename ArgPack>
     explicit backend0(
         ArgPack const& args
-      , typename boost::enable_if<
-            is_argument_pack<ArgPack>
+      , typename boost::enable_if<
+            is_argument_pack<ArgPack>
           , _enabler
         >::type = _enabler()
     ) : a0(args[_a0])
@@ -8719,10 +6199,8 @@ class backend1 : public B
     template <typename ArgPack>
     explicit backend1(
         ArgPack const& args
-      , typename boost::enable_if<
-            is_argument_pack<ArgPack>
+      , typename boost::enable_if<
+            is_argument_pack<ArgPack>
           , _enabler
         >::type = _enabler()
     ) : B(args), a1(args[_a1])
@@ -8744,10 +6222,8 @@ class backend2 : public B
     template <typename ArgPack>
     explicit backend2(
         ArgPack const& args
-      , typename boost::enable_if<
-            is_argument_pack<ArgPack>
+      , typename boost::enable_if<
+            is_argument_pack<ArgPack>
           , _enabler
         >::type = _enabler()
     ) : B(args), a2(args[_a2])
@@ -8760,12 +6236,11 @@ href="../../../core/doc/html/core/enable_if.html">enable_if<
     }
 };
 
-

This example shows that while backend0 -must always be the root base class template and that frontend must always be the most derived class -template, the other back-ends can be chained together in different orders.

-
-char const* p = "foo";
+

This example shows that while backend0 must always be the root base class +template and that frontend must always be the most derived class template, +the other back-ends can be chained together in different orders.

+
+char const* p = "foo";
 frontend<
     backend2<backend1<backend0<char const*>, char>, int>
 > composed_obj0(_a2 = 4, _a1 = ' ', _a0 = p);
@@ -8776,75 +6251,39 @@ BOOST_TEST_EQ(composed_obj0.get_a0(), composed_obj1.get_a0());
 BOOST_TEST_EQ(composed_obj0.get_a1(), composed_obj1.get_a1());
 BOOST_TEST_EQ(composed_obj0.get_a2(), composed_obj1.get_a2());
 
-

The test/parameterized_inheritance.cpp and test/preprocessor_eval_cat_no_spec.cpp test programs demonstrate proper -usage of this macro.

- - - -Macro parameters: - - -  - -
    -
  • cls is the name of the enclosing -class.
  • -
  • impl is the parenthesized implementation -base class for cls.
  • +

    The parameterized_inheritance.cpp and preprocessor_eval_cat_no_spec.cpp test +programs demonstrate proper usage of this macro.

    +

    Macro parameters:

    +
      +
    • cls is the name of the enclosing class.
    • +
    • impl is the parenthesized implementation base class for cls.
    - - - -Argument specifiers syntax: - - -  -None. - - - -
    -
    Approximate expansion:
    -
    -
    +

    Argument specifiers syntax:

    +

    None.

    +

    Approximate expansion:

    +
     template <
    -    template <
    -        typename TaggedArg0
    -      , typename ...TaggedArgs
    -      , typename = typename boost::enable_if<
    -            are_tagged_arguments<TaggedArg0,TaggedArgs...>
    -        >::type
    +    typename TaggedArg0
    +  , typename ...TaggedArgs
    +  , typename = typename boost::enable_if<
    +        are_tagged_arguments<TaggedArg0,TaggedArgs...>
    +    >::type
     >
     inline explicit cls(
         TaggedArg0 const& arg0
       , TaggedArgs const&... args
    -) : impl(compose(arg0, args...))
    +) : impl(compose(arg0, args...))
     {
     }
     
    -
    -
-
-

7.18   BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(cls, -func)

+
+

7.18   BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(cls, impl)

- - - +
Defined in:boost/parameter/preprocessor_no_spec.hpp
Defined in:boost/parameter/preprocessor_no_spec.hpp
@@ -8853,68 +6292,44 @@ href="../../../../boost/parameter/preprocessor_no_spec.hpp" - -Example usage: +Example usage: - -  - -

The return type of each of the following functon templates falls under a + + +

The return type of each of the following function templates falls under a different value category.

-
+
 template <std::size_t N>
-std::bitset<N + 1> rvalue_bitset()
+std::bitset<N + 1> rvalue_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const rvalue_const_bitset()
+std::bitset<N + 1> const rvalue_const_bitset()
 {
-    return std::bitset<N + 1>();
+    return std::bitset<N + 1>();
 }
 
 template <std::size_t N>
-std::bitset<N + 1>& lvalue_bitset()
+std::bitset<N + 1>& lvalue_bitset()
 {
-    static std::bitset<N + 1> lset = std::bitset<N + 1>();
+    static std::bitset<N + 1> lset = std::bitset<N + 1>();
     return lset;
 }
 
 template <std::size_t N>
-std::bitset<N + 1> const& lvalue_const_bitset()
+std::bitset<N + 1> const& lvalue_const_bitset()
 {
-    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
+    static std::bitset<N + 1> const clset = std::bitset<N + 1>();
     return clset;
 }
 
-

The U::evaluate_category static member -function template has a simple job: to return the correct value category when -passed in an object returned by one of the functions defined above. Assume -that BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

-
+

The U::evaluate_category static member function template has a simple job: +to return the correct value category when passed in an object returned by one +of the functions defined above. Assume that +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.

+
 enum invoked
 {
     passed_by_lvalue_reference_to_const
@@ -8926,57 +6341,42 @@ enum invoked
 struct U
 {
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&)
+    static invoked evaluate_category(std::bitset<N + 1> const&)
     {
         return passed_by_lvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&)
+    static invoked evaluate_category(std::bitset<N + 1>&)
     {
         return passed_by_lvalue_reference;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1> const&&)
+    static invoked evaluate_category(std::bitset<N + 1> const&&)
     {
         return passed_by_rvalue_reference_to_const;
     }
 
     template <std::size_t N>
-    static invoked evaluate_category(std::bitset<N + 1>&&)
+    static invoked evaluate_category(std::bitset<N + 1>&&)
     {
         return passed_by_rvalue_reference;
     }
 };
 
-

Named parameters are required when invoking the constructor; however, none -of their tags need to be in the same namespace.

-
-BOOST_PARAMETER_NAME((_lrc, kw0) in(lrc))
-BOOST_PARAMETER_NAME((_lr, kw1) in_out(lr))
-BOOST_PARAMETER_NAME((_rrc, kw2) in(rrc))
-BOOST_PARAMETER_NAME((_rr, kw3) consume(rr))
+

Named parameters are required when invoking the constructor; however, none of +their tags need to be in the same namespace.

+
+BOOST_PARAMETER_NAME((_lrc, kw0) in(lrc))
+BOOST_PARAMETER_NAME((_lr, kw1) in_out(lr))
+BOOST_PARAMETER_NAME((_rrc, kw2) in(rrc))
+BOOST_PARAMETER_NAME((_rr, kw3) consume(rr))
 
-

Unlike BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR, this -macro doesn't require a base class, only a delegate function to which the -generated constructor can pass its ArgumentPack.

-
+

Unlike BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR, this macro doesn't require a +base class, only a delegate function to which the generated constructor can +pass its ArgumentPack.

+
 struct D
 {
     BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(D, D::_evaluate)
@@ -8996,13 +6396,13 @@ struct D
         BOOST_TEST_EQ(
             passed_by_rvalue_reference_to_const
           , U::evaluate_category<2>(
-                args[_rrc0 | rvalue_const_bitset<2>()]
+                args[_rrc | rvalue_const_bitset<2>()]
             )
         );
         BOOST_TEST_EQ(
             passed_by_rvalue_reference
           , U::evaluate_category<3>(
-                args[_rr0 | rvalue_bitset<3>()]
+                args[_rr | rvalue_bitset<3>()]
             )
         );
 
@@ -9011,7 +6411,7 @@ struct D
 };
 

To invoke the constructor, bind all its arguments to named parameters.

-
+
 D dp0(
     _rr0 = rvalue_bitset<3>()
   , _lrc0 = lvalue_const_bitset<0>()
@@ -9023,100 +6423,61 @@ D dp1(
   , _lrc0 = lvalue_const_bitset<0>()
 );
 
-

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

- - - -Macro parameters: - - -  - -
    -
  • cls is the name of the enclosing -class.
  • -
  • func is a function that takes in the -ArgumentPack that the generated constructor passes on.
  • +

    The preprocessor_eval_cat_no_spec.cpp test program demonstrates proper usage of +this macro.

    +

    Macro parameters:

    +
      +
    • cls is the name of the enclosing class.
    • +
    • func is a function that takes in the ArgumentPack that the +generated constructor passes on.
    - - - -Argument specifiers syntax: - - -  -None. - - - -
    -
    Approximate expansion:
    -
    -
    +

    Argument specifiers syntax:

    +

    None.

    +

    Approximate expansion:

    +
     template <
    -    template <
    -        typename TaggedArg0
    -      , typename ...TaggedArgs
    -      , typename = typename boost::enable_if<
    -            are_tagged_arguments<TaggedArg0,TaggedArgs...>
    -        >::type
    +    typename TaggedArg0
    +  , typename ...TaggedArgs
    +  , typename = typename boost::enable_if<
    +        are_tagged_arguments<TaggedArg0,TaggedArgs...>
    +    >::type
     >
     inline explicit cls(
         TaggedArg0 const& arg0
       , TaggedArgs const&... args
     )
     {
    -    func(compose(arg0, args...));
    +    func(compose(arg0, args...));
     }
     
    -
    -
-

7.19   BOOST_PARAMETER_NAME(name)

+

7.19   BOOST_PARAMETER_NAME(name)

- - - +
Defined in:boost/parameter/name.hpp
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)
+(object-name, namespace-name) qualifier(tag-name)
 

then

- - - + + +
Requires: -

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

-
Requires:qualifier is either in, out, in_out, consume, +move_from, or forward.
Expands to:
-

Expands to:

 namespace namespace-name {
 
@@ -9124,7 +6485,7 @@ namespace namespace-name {
     {
         static constexpr char const* keyword_name()
         {
-            return ##tag-name;
+            return ## tag-name;
         }
 
         typedef unspecified _;
@@ -9132,35 +6493,30 @@ namespace namespace-name {
         typedef boost::parameter::qualifier ## _reference qualifier;
 
         // The following definitions are available only when
-        // BOOST_PARAMETER_CAN_USE_MP11 is defined.
+        // BOOST_PARAMETER_CAN_USE_MP11 is defined.
 
         template <typename ArgumentPack>
-        using binding_fn = typename binding<
+        using binding_fn = typename binding<
             ArgumentPack
           , tag-name
         >::type;
 
         template <typename ArgumentPack>
-        using fn = typename value_type<ArgumentPack, tag-name>::type;
+        using fn = typename value_type<ArgumentPack, tag-name>::type;
     };
 }
 
-keyword<tag-namespace::tag-name> const& object-name
-    = keyword<tag-namespace::tag-name>::instance;
+keyword<tag-namespace::tag-name> const& object-name
+    = keyword<tag-namespace::tag-name>::instance;
 

Else If name is of the form:

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

then

Treats name as if it were of the form:

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

Else If name is of the form:

@@ -9171,19 +6527,13 @@ href="#binding">binding<
 
 
 
-
-Requires:
-
-

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

- +Requires:qualifier is either in, out, in_out, consume, +move_from, or forward. + +Expands to: -

Expands to:

 namespace tag {
 
@@ -9191,7 +6541,7 @@ namespace tag {
     {
         static constexpr char const* keyword_name()
         {
-            return ##tag-name;
+            return ## tag-name;
         }
 
         typedef unspecified _;
@@ -9199,26 +6549,21 @@ namespace tag {
         typedef boost::parameter::qualifier ## _reference qualifier;
 
         // The following definitions are available only when
-        // BOOST_PARAMETER_CAN_USE_MP11 is defined.
+        // BOOST_PARAMETER_CAN_USE_MP11 is defined.
 
         template <typename ArgumentPack>
-        using binding_fn = typename binding<
+        using binding_fn = typename binding<
             ArgumentPack
           , tag-name
         >::type;
 
         template <typename ArgumentPack>
-        using fn = typename value_type<ArgumentPack, tag-name>::type;
+        using fn = typename value_type<ArgumentPack, tag-name>::type;
     };
 }
 
-keyword<tag::tag-name> const& _ ## tag-name
-    = keyword<tag::tag-name>::instance;
+keyword<tag::tag-name> const& _ ## tag-name
+    = keyword<tag::tag-name>::instance;
 

Else

Treats name as if it were of the form:

@@ -9226,24 +6571,18 @@ href="#binding">binding< forward(tag-name)
-
-

7.20   BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, -alias)

+
+

7.20   BOOST_PARAMETER_NESTED_KEYWORD(tag_namespace, name, alias)

- - - +
Defined in:boost/parameter/nested_keyword.hpp
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.

+

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)
@@ -9253,19 +6592,13 @@ in the tag-type.

- -Requires: - -

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

- +Requires:qualifier is either in, out, in_out, consume, +move_from, or forward. + +Expands to: -

Expands to:

 namespace tag {
 
@@ -9273,41 +6606,33 @@ namespace tag {
     {
         static constexpr char const* keyword_name()
         {
-            return ##tag-name;
+            return ## tag-name ## _;
         }
 
         typedef unspecified _;
         typedef unspecified _1;
         typedef boost::parameter::qualifier ## _reference qualifier;
-        static keyword<tag-name> const& alias;
+        static keyword<tag-name> const& alias;
 
         // The following definitions are available only when
-        // BOOST_PARAMETER_CAN_USE_MP11 is defined.
+        // BOOST_PARAMETER_CAN_USE_MP11 is defined.
 
         template <typename ArgumentPack>
-        using binding_fn = typename binding<
+        using binding_fn = typename binding<
             ArgumentPack
           , tag-name
         >::type;
 
         template <typename ArgumentPack>
-        using fn = typename value_type<ArgumentPack, tag-name>::type;
+        using fn = typename value_type<ArgumentPack, tag-name>::type;
     };
 
-    keyword<tag-name> const& tag-name::alias
-        = keyword<tag-name>::instance;
+    keyword<tag-name> const& tag::tag-name::alias
+        = keyword<tag-name>::instance;
 }
 
-keyword<tag::tag-name> const& name
-    = keyword<tag::tag-name>::instance;
+keyword<tag::tag-name> const& tag::tag-name::name
+    = keyword<tag::tag-name>::instance;
 

Else

Treats name as if it were of the form:

@@ -9316,26 +6641,19 @@ forward(tag-name)
-

7.21   BOOST_PARAMETER_TEMPLATE_KEYWORD(name)

+

7.21   BOOST_PARAMETER_TEMPLATE_KEYWORD(name)

- - - + - - - + + +
Defined in:boost/parameter/template_keyword.hpp
Defined in:boost/parameter/template_keyword.hpp
Included by:boost/parameter/name.hpp
Included by:boost/parameter/name.hpp
Expands to:
-

Expands to:

 namespace tag {
 
@@ -9343,82 +6661,51 @@ namespace tag {
 }
 
 template <typename T>
-struct name : template_keyword<tag::name, T>
+struct name : template_keyword<tag:: name, T>
 {
 };
 
-

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

+

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

-

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

+

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

Deprecated

This macro has been deprecated in favor of -BOOST_PARAMETER_FUNCTION.

+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.

+

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
Defined in:boost/parameter/macros.hpp
Requires:l and h are nonnegative integer tokens +such that l < h
Expands to:
- --- - - - - - -
Requires:l and h are nonnegative integer tokens such that l < h
-
-
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()
+        A1 && a1, A2 && a2, …, A ## l && a ## l
+      , typename p::match<A1, A2, …, A ## l>::type p = p()
     )
 {
     return name_with_named_params(
-        pk(
-            std::forward<A1>(a1)
-          , std::forward<A2>(a2)
+        p(
+            std::forward<A1>(a1)
+          , std::forward<A2>(a2)
           , …
-          , std::forward<A ## l>(a ## l)
+          , std::forward<A ## l>(a ## l)
         )
     );
 }
@@ -9428,43 +6715,26 @@ template <
   , typename A2
   , …
   , typename A ## l
-  , typename A ## BOOST_PP_INC(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())
+        A1 && a1, A2 && a2, …, A ## l && a ## l
+      , A ## BOOST_PP_INC(l) const& a ## BOOST_PP_INC(l)
+      , typename p::match<
+            A1, A2, …, A ## l, A ## BOOST_PP_INC(l)
+        >::type p = p()
+    )
 {
     return name_with_named_params(
-        pk(
-            std::forward<A1>(a1)
-          , std::forward<A2>(a2)
+        p(
+            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))
+          , std::forward<A ## l>(a ## l)
+          , std::forward<A ## BOOST_PP_INC(l)>(
+                a ## BOOST_PP_INC(l)
+            )
         )
     );
 }
@@ -9474,72 +6744,51 @@ href="../../../preprocessor/doc/ref/inc.html">BOOST_PP_INC(h>
 r
     name(
-        A1&& a1, A2&& a2, …, A ## h && a ## h
-      , typename p::match<A1, A2, …, A ## h>::type pk = p()
+        A1 && a1, A2 && a2, …, A ## h && x ## h
+      , typename p::match<A1, A2, …, A ## h>::type p = p()
     )
 {
     return name_with_named_params(
-        pk(
-            std::forward<A1>(a1)
-          , std::forward<A2>(a2)
+        p(
+            std::forward<A1>(a1)
+          , std::forward<A2>(a2)
           , …
-          , std::forward<A ## h>(a ## h)
+          , std::forward<A ## h>(a ## h)
         )
     );
 }
 
-
-
-

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

+

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

-

7.23   BOOST_PARAMETER_KEYWORD(n, k)

+

7.23   BOOST_PARAMETER_KEYWORD(n, k)

Deprecated

This macro has been deprecated in favor of -BOOST_PARAMETER_NAME.

+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.

+

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
Defined in:boost/parameter/keyword.hpp
Expands to:
-
-
Generates
-
+
 namespace n {
 
     struct k
     {
         static constexpr char const* keyword_name()
         {
-            return ##k;
+            return ## k;
         }
 
         typedef unspecified _;
@@ -9547,245 +6796,138 @@ namespace n {
         typedef boost::parameter::forward_reference qualifier;
 
         // The following definitions are available only when
-        // BOOST_PARAMETER_CAN_USE_MP11 is defined.
+        // BOOST_PARAMETER_CAN_USE_MP11 is defined.
 
         template <typename ArgumentPack>
-        using binding_fn = typename binding<
+        using binding_fn = typename binding<
             ArgumentPack
           , k
         >::type;
 
         template <typename ArgumentPack>
-        using fn = typename value_type<ArgumentPack, k>::type;
+        using fn = typename value_type<ArgumentPack, k>::type;
     };
 }
 
 namespace {
 
-    keyword<n::k> const& k
-        = keyword<n::k>::instance;
+    keyword<n::k> const& k
+        = keyword<n::k>::instance;
 }
 
-
-
-

7.24   BOOST_PARAMETER_MATCH(p, a, x)

-

Generates a defaulted parameter declaration for a -forwarding function.

+

7.24   BOOST_PARAMETER_MATCH(p, a, x)

+

Generates a defaulted parameter declaration for a forwarding function.

- - - + + +
Defined in:boost/parameter/match.hpp
Defined in:boost/parameter/match.hpp
Requires:a is a Boost.Preprocessor sequence of the form
+
+(A0)(A1)…(A ## n)
+
- - - +
Requires: -

a is a -Boost.Preprocessor sequence of the form

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

8   Configuration -Macros

-
-

8.1   BOOST_PARAMETER_HAS_PERFECT_FORWARDING

+

8   Configuration Macros

+
+

8.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 is not already defined, and if 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.

+macro by #defining the BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING +macro. Otherwise, the library will #define this macro if and only if it +is not already defined, and if the configuration macros +BOOST_NO_FUNCTION_TEMPLATE_ORDERING, BOOST_NO_SFINAE, +BOOST_NO_CXX11_RVALUE_REFERENCES, BOOST_NO_CXX11_VARIADIC_TEMPLATES, and +BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS are not already defined by +Boost.Config.

- - - +
Defined in:boost/parameter/config.hpp
Defined in:boost/parameter/config.hpp
-
-

8.2   BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING

+
+

8.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 both BOOST_PARAMETER_HAS_PERFECT_FORWARDING and BOOST_PARAMETER_CAN_USE_MP11 undefined.

+unavailable. Users can #define this macro either in their project +settings or before including any library header files. Doing so will leave +both BOOST_PARAMETER_HAS_PERFECT_FORWARDING and +BOOST_PARAMETER_CAN_USE_MP11 undefined.

-
-

8.3   BOOST_PARAMETER_CAN_USE_MP11

-

Determines whether or not the library can use Boost.MP11, a C++11 -metaprogramming library, and therefore determines whether or not the library -defines the are_tagged_arguments_mp11 and is_argument_pack_mp11 metafunctions. Users can manually disable -this macro by #defining the BOOST_PARAMETER_DISABLE_MP11_USAGE macro or -the BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING -macro. Otherwise, the library will #define -this macro if and only if it is not already defined, if BOOST_PARAMETER_HAS_PERFECT_FORWARDING is -defined, and if the configuration macros BOOST_NO_CXX11_CONSTEXPR, -BOOST_NO_CXX11_DECLTYPE_N3276, -BOOST_NO_CXX11_AUTO_DECLARATIONS, -BOOST_NO_CXX11_TEMPLATE_ALIASES, -BOOST_NO_CXX11_STATIC_ASSERT, -BOOST_NO_CXX11_HDR_TYPE_TRAITS, -BOOST_NO_CXX11_HDR_INITIALIZER_LIST, -and BOOST_NO_CXX11_HDR_TUPLE are not -already defined by Boost.Config.

-
+
+

8.3   BOOST_PARAMETER_CAN_USE_MP11

+

Determines whether or not the library can use Boost.MP11, a C++11 +metaprogramming library. Users can manually disable this macro by +#defining the BOOST_PARAMETER_DISABLE_MP11_USAGE macro or the +BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING macro. Otherwise, the library +will #define this macro if and only if it is not already defined, if +BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined, and if the configuration +macros BOOST_NO_CXX11_CONSTEXPR, BOOST_NO_CXX11_DECLTYPE_N3276, +BOOST_NO_CXX11_AUTO_DECLARATIONS, BOOST_NO_CXX11_TEMPLATE_ALIASES, +BOOST_NO_CXX11_STATIC_ASSERT, BOOST_NO_CXX11_HDR_TYPE_TRAITS, +BOOST_NO_CXX11_HDR_INITIALIZER_LIST, and BOOST_NO_CXX11_HDR_TUPLE +are not already defined by Boost.Config.

+

Usage Note

-

Boost.MP11 and Boost.MPL -are not mutually exclusive. It's perfectly acceptable to -specify deduced parameters using both quoted metafunctions and metafunction -classes, for example. See test/evaluate_category.cpp.

+

Boost.MP11 and Boost.MPL are not mutually exclusive. It's +perfectly acceptable to specify deduced parameters using both quoted +metafunctions and metafunction classes, for example. See +evaluate_category.cpp.

- - - + + +
Defined in:boost/parameter/config.hpp
Defined in:boost/parameter/config.hpp
Example usage:
- --- - - - - - - +

The singular.cpp, compose.cpp, optional_deduced_sfinae.cpp, and +deduced_dependent_predicate.cpp test programs demonstrate proper usage of this +macro.

+ +
+

8.4   BOOST_PARAMETER_DISABLE_MP11_USAGE

+

It may be necessary to disable usage of Boost.MP11 for compilers that +cannot support it. Users can #define this macro either in their project +settings or before including any library header files. Doing so will leave +BOOST_PARAMETER_CAN_USE_MP11 undefined.

+
+
+

8.5   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::mp11::mp_list if +BOOST_PARAMETER_CAN_USE_MP11 is defined, 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 usage:
 

Given the following definitions:

-
-BOOST_PARAMETER_NAME(x)
+
+BOOST_PARAMETER_NAME(x)
 
 template <typename A0>
-typename boost::enable_if<std::is_same<int,A0>,int>::type
+typename boost::enable_if<std::is_same<int,A0>,int>::type
     sfinae(A0 const& a0)
 {
     return 0;
 }
 
-

Boost.MP11 allows deduced parameters to be defined more succinctly:

-
+

Boost.MP11 allows deduced parameters to be defined more succinctly:

+
 template <typename T, typename Args>
-using predicate = std::is_convertible<T,char const*>;
+using predicate = std::is_convertible<T,char const*>;
 
-BOOST_PARAMETER_FUNCTION((int), sfinae, tag,
+BOOST_PARAMETER_FUNCTION((int), sfinae, tag,
     (deduced
         (optional
             (x
-              , *(boost::mp11::mp_quote<predicate>)
-              , static_cast<char const*>(nullptr)
+              , *(boost::mp11::mp_quote<predicate>)
+              , static_cast<char const*>(std::nullptr)
             )
         )
     )
@@ -9794,66 +6936,58 @@ href="http://en.cppreference.com/w/cpp/language/nullptr">nullptr)
     return 1;
 }
 
-

Without Boost.MP11, deduced parameter -definitions tend to be more verbose:

-
+

Without Boost.MP11, deduced parameter definitions tend to be more verbose:

+
 struct predicate
 {
     template <typename T, typename Args>
     struct apply
-      : boost::mpl::if_<
-            boost::is_convertible<T,char const*>
-          , boost::mpl::true_
-          , boost::mpl::false_
+      : mpl::if_<
+            boost::is_convertible<T,char const*>
+          , mpl::true_  // Still have to convert to a
+          , mpl::false_ // Boolean Integral Constant.
         >
     {
     };
 };
 
-BOOST_PARAMETER_FUNCTION((int), sfinae, tag,
+BOOST_PARAMETER_FUNCTION((int), sfinae, tag,
     (deduced
         (optional
             (x
               , *(predicate)
-              , static_cast<char const*>(nullptr)
+              , static_cast<char const*>(std::nullptr)
             )
         )
     )
 )
+{
+    return 1;
+}
 

Either way, the following assertions will succeed:

-
+
 assert(1 == sfinae());
 assert(1 == sfinae("foo"));
 assert(0 == sfinae(1));
 

As another example, given the following declarations and definitions:

-
-BOOST_PARAMETER_NAME(x)
-BOOST_PARAMETER_NAME(y)
+
+BOOST_PARAMETER_NAME(x)
+BOOST_PARAMETER_NAME(y)
 
 template <typename E, typename Args>
 void check0(E const& e, Args const& args);
 
-template <typename P, typename E, typename Args>
+template <typename P, typename E, typename ...Args>
 void check(E const& e, Args const&... args)
 {
     check0(e, P()(args...));
 }
 
-

Argument packs qualify as Boost.MP11-style lists containing -keyword tag -types:

-
+

Argument packs qualify as Boost.MP11-style lists containing +keyword tag types:

+
 template <typename Args>
 struct some_functor
 {
@@ -9870,32 +7004,24 @@ void check0(E const& e, Args const& args)
     boost::mp11::mp_for_each<E>(some_functor<Args>());
 }
 
-

The first check determines whether or not the argument type of _y is the same as the reference type of _x, while the second check determines whether -or not the argument type of _y is -convertible to the value type of _x. Here, -it's possible to access the reference and value result types of indexing an -argument pack a little more directly:

-
+

The first check determines whether or not the argument type of _y is the +same as the reference type of _x, while the second check determines +whether or not the argument type of _y is convertible to the value type of +_x. Here, it's possible to access the reference and value result types of +indexing an argument pack a little more directly:

+
 // Use mp_bind on tag::x::binding_fn to access the reference type of _x.
-// Here, boost::mp11::_1 will be bound to the argument type of _y.
-// Regardless, boost::mp11::_2 will be bound to the argument pack type.
 check<
-    parameters<
+    parameters<
         tag::x
-      , optional<
-            deduced<tag::y>
-          , boost::mp11::mp_bind<
-                std::is_same
-              , boost::mp11::_1
-              , boost::mp11::mp_bind<
+      , optional<
+            deduced<tag::y>
+          , boost::mp11::mp_bind<
+                std::is_same // boost::is_same, standard version.
+              , boost::mp11::_1 // will be bound to the argument type of _y.
+              , boost::mp11::mp_bind<
                     tag::x::binding_fn
-                  , boost::mp11::_2
+                  , boost::mp11::_2 // will be bound to the argument pack type.
                 >
             >
         >
@@ -9904,27 +7030,25 @@ href="http://en.cppreference.com/w/cpp/types/is_same"
 
 // Use mp_bind_q on tag::x to access the value type of _x.
 check<
-    parameters<
+    parameters<
         tag::x
-      , optional<
-            deduced<tag::y>
-          , boost::mp11::mp_bind<
-                std::is_convertible
-              , boost::mp11::_1
-              , boost::mp11::mp_bind_q<tag::x,boost::mp11::_2>
+      , optional<
+            deduced<tag::y>
+          , boost::mp11::mp_bind<
+                std::is_convertible // boost::is_convertible, standard version.
+              , boost::mp11::_1 // will be bound to the argument type of _y.
+              , boost::mp11::mp_bind_q<
+                    tag::x
+                  , boost::mp11::_2 // will be bound to the argument pack type.
+                >
             >
         >
     >
 >((_x = 0U, _y = 1U), 0U, 1U);
 
-

Argument packs still qualify as Boost.MPL-style lists containing keyword tag types:

-
+

Argument packs still qualify as Boost.MPL-style lists containing +keyword tag types:

+
 template <typename Args>
 struct some_functor
 {
@@ -9941,29 +7065,21 @@ void check0(E const& e, Args const& args)
     boost::mpl::for_each<E>(some_functor<Args>());
 }
 
-

However, without Boost.MP11, the corresponding -checks become a little more verbose:

-
+

However, without Boost.MP11, the corresponding checks become a little more +verbose:

+
 check<
-    parameters<
+    parameters<
         tag::x
-      , optional<
-            deduced<tag::y>
-          , boost::mpl::if_<
-                boost::is_same<
-                    boost::add_lvalue_reference<boost::mpl::_1>
-                  , binding<boost::mpl::_2,tag::x>
+      , optional<
+            deduced<tag::y>
+          , mpl::if_<
+                boost::is_same<
+                    boost::add_lvalue_reference<boost::mp11::_1>
+                  , binding<boost::mp11::_2, tag::x>
                 >
-              , boost::mpl::true_
-              , boost::mpl::false_
+              , mpl::true_  // Still have to convert to a
+              , mpl::false_ // Boolean Integral Constant.
             >
         >
     >
@@ -9971,516 +7087,228 @@ href="../../../type_traits/doc/html/boost_typetraits/is_same.html"
 
 // Use tag::x::_ or tag::x::_1 to access the value type of _x.
 check<
-    parameters<
+    parameters<
         tag::x
-      , optional<
-            deduced<tag::y>
-          , boost::mpl::if_<
-                boost::is_convertible<boost::mpl::_1,tag::x::_1>
-              , boost::mpl::true_
-              , boost::mpl::false_
+      , optional<
+            deduced<tag::y>
+          , mpl::if_<
+                boost::is_convertible<boost::mp11::_1, tag::x::_1>
+              , mpl::true_  // Still have to convert to a
+              , mpl::false_ // Boolean Integral Constant.
             >
         >
     >
 >((_x = 0U, _y = 1U), 0U, 1U);
 
-

The test/singular.cpp, test/compose.cpp, test/optional_deduced_sfinae.cpp, and test/deduced_dependent_predicate.cpp test programs demonstrate proper -usage of this macro.

-
+++ +
Example:
-
-
-

8.4   BOOST_PARAMETER_DISABLE_MP11_USAGE

-

It may be necessary to disable usage of Boost.MP11 for compilers that -cannot support it. Users can #define this -macro either in their project settings or before including any library header -files. Doing so will leave BOOST_PARAMETER_CAN_USE_MP11 undefined and the are_tagged_arguments_mp11 and is_argument_pack_mp11 metafunctions -unavailable.

-
-
-

8.5   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::mp11::mp_list if -BOOST_PARAMETER_CAN_USE_MP11 is defined, -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
+
+#define BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE boost::fusion::vector
 
-
-
- - - +
Defined in:boost/parameter/parameters.hpp
Defined in:boost/parameter/parameters.hpp
-
-

8.6   BOOST_PARAMETER_MAX_ARITY

-

If BOOST_PARAMETER_HAS_PERFECT_FORWARDING is -#defined, then:

-