diff --git a/doc/html/index.html b/doc/html/index.html old mode 100755 new mode 100644 index edb5760..36f9e4b --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,7 +3,7 @@ - + The Boost Parameter Library @@ -11,7 +11,7 @@

The Boost Parameter Library

-

Boost

+

Boost


@@ -78,100 +78,65 @@ int x = '''); --> - + - + +or copy at http://www.boost.org/LICENSE_1_0.txt)
Authors:David Abrahams, Daniel Wallin
Contact:dave@boost-consulting.com, dalwan01@student.umu.se
Contact:dave@boost-consulting.com, dalwan01@student.umu.se
Organization:Boost Consulting
Organization:Boost Consulting
Date:$Date: 2005/07/18 20:34:31 $
Copyright:Copyright David Abrahams, Daniel Wallin 2005. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt -or copy at http://www.boost.org/LICENSE_1_0.txt)

-
-

Table of Contents

+

[Note: this tutorial does not cover all details of the library. Please see also the reference documentation]

+
+

Table of Contents


-
-

1   Motivation

-

In C++, arguments are normally given meaning by their positions -with respect to a parameter list: the first argument passed maps +

+

1   Motivation

+

In C++, arguments are normally given meaning by their positions +with respect to a parameter list: the first argument passed maps onto the first parameter in a function's definition, and so on. That protocol is fine when there is at most one parameter with a default value, but when there are even a few useful defaults, the @@ -218,8 +183,8 @@ arguments either, leading to hard-to-find bugs.

-
-

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 @@ -230,8 +195,8 @@ window* w = new_window("alert box", movable_=false);

-
-

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 @@ -251,8 +216,8 @@ 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 @@ -277,16 +242,16 @@ smart_ptr<Client, shared> q;

-
-

2   Tutorial

+
+

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.

-
-

2.1   Parameter-Enabled Functions

+
+

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

+build an expressive interface to the Boost Graph library's +depth_first_search algorithm.1

-
-

2.1.1   Headers And Namespaces

+
+

2.1.1   Headers And Namespaces

Most components of the Parameter library are declared in a header named for the component. For example,

@@ -323,8 +288,8 @@ namespace parameter = boost::parameter;
 

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

-
-

2.1.2   The Abstract Interface to depth_first_search

+
+

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:

@@ -343,7 +308,7 @@ void depth_first_search(

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

- +@@ -360,13 +325,13 @@ shown in the table below.

- + - + @@ -377,7 +342,7 @@ type. - @@ -385,7 +350,7 @@ an integer type. -
depth_first_search Parametersdepth_first_search Parameters
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 VisitorModel of DFS Visitor boost::dfs_visitor<>()
root_vertex
index_map inModel of Readable Property Map +Model of Readable Property Map with key type := graph's vertex descriptor and value type an integer type.
color_map in/outModel of Read/Write Property Map +Model of Read/Write Property Map with key type := graph's vertex descriptor type. an iterator_property_map @@ -400,8 +365,8 @@ created from a std::vector columns above. For the purposes of this exercise, you don't need to understand them in detail.

-
-

2.1.3   Defining the Keywords

+
+

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:

@@ -457,12 +422,12 @@ namespace graphs

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

+units (MSVC6.x users see this note).

-
-

2.1.4   Writing the Function

+
+

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:

@@ -523,16 +488,16 @@ match the function's parameter names.
  • The function signature.
  • -
    -

    2.1.5   Function Signatures

    +
    +

    2.1.5   Function Signatures

    Function signatures are described as one or two adjacent -parenthesized terms (a Boost.Preprocessor sequence) describing +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

    +
    +

    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 @@ -559,16 +524,15 @@ BOOST_PARAMETER_FUNCTION((void), f, tag,

    -
    -

    2.1.5.2   Optional Parameters

    +
    +

    2.1.5.2   Optional Parameters

    Optional parameters—nested in an (optional ) clause—are given as a series of adjacent three-element tuples describing the parameter name, any requirements on the argument type, and and an expression representing the parameter's default value:

    -(optional
    -    (visitor,           *, boost::dfs_visitor<>())
    +(optional     (visitor,           *, boost::dfs_visitor<>())
         (root_vertex,       *, *vertices(graph).first)
         (index_map,         *, get(boost::vertex_index,graph))
         (in_out(color_map), *,
    @@ -600,8 +564,8 @@ BOOST_PARAMETER_FUNCTION((void), f, tag,
     
     
     
    -
    -

    2.1.5.3   Handling “Out” Parameters

    +
    +

    2.1.5.3   Handling “Out” Parameters

    Within the function body, a parameter name such as visitor is a C++ reference, bound either to an actual argument passed by @@ -613,9 +577,9 @@ indicate that color_mapin_out(…):

     (optional
    -    (visitor,           *, boost::dfs_visitor<>())
    -    (root_vertex,       *, *vertices(graph).first)
    -    (index_map,         *, get(boost::vertex_index,graph))
    +    (visitor,            *, boost::dfs_visitor<>())
    +    (root_vertex,        *, *vertices(graph).first)
    +    (index_map,          *, get(boost::vertex_index,graph))
         (in_out(color_map), *,
           default_color_map(num_vertices(graph), index_map) )
     )
    @@ -650,8 +614,8 @@ we could have written out(color_m
     difference between out and in_out; the library provides
     both so you can make your interfaces more self-documenting.

    -
    -

    2.1.5.4   Positional Arguments

    +
    +

    2.1.5.4   Positional Arguments

    When arguments are passed positionally (without the use of keywords), they will be mapped onto parameters in the order the parameters are given in the signature, so for example in this @@ -663,8 +627,8 @@ graphs::depth_first_search(x, y);

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

    -
    -

    2.1.5.5   Default Expression Evaluation

    +
    +

    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, @@ -737,8 +701,8 @@ BOOST_PARAMETER_NAME(color_map)''') --> ''') -->

    -
    -

    2.1.5.6   Signature Matching and Overloading

    +
    +

    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 @@ -760,13 +724,13 @@ 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 +implementation when you make a mistake).4

  • 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 +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?
  • +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 @@ -775,7 +739,7 @@ appropriate. The library already does this when the required 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, +Incidence Graph? If we just added a simple overload, it would be ambiguous:

     // new overload
    @@ -791,11 +755,11 @@ BOOST_PARAMETER_FUNCTION(
     depth_first_search(boost::adjacency_list<>(), 2, "hello");
     
    -
    -
    2.1.5.6.1   Adding Type Requirements
    +
    +
    2.1.5.6.1   Adding Type 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 +"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 need to tell @@ -818,11 +782,11 @@ signature—and in the function body—as foo, write foo_type.

    -
    -
    2.1.5.6.2   Predicate Requirements
    +
    +
    2.1.5.6.2   Predicate Requirements

    The requirements on other arguments are a bit more interesting than those on root_vertex; they can't be described in terms of simple -type matching. Instead, they must be described in terms of MPL +type matching. Instead, they must be described in terms of MPL Metafunctions. There's no space to give a complete description of metafunctions or of graph library details here, but we'll show you the complete signature with maximal checking, just to give you @@ -918,14 +882,14 @@ type requirements on arguments to generic functions. However, it is usally worth the effort to do so: your code will be more self-documenting and will often provide a better user experience. You'll also have an easier transition to an upcoming C++ standard -with language support for concepts.

    +with language support for concepts.

    -
    -

    2.1.5.7   Deduced Parameters

    +
    +

    2.1.5.7   Deduced Parameters

    To illustrate deduced parameter support we'll have to leave behind our example from the Graph library. Instead, consider the example -of the def function from Boost.Python. Its signature is +of the def function from Boost.Python. Its signature is roughly as follows:

     template <
    @@ -967,14 +931,14 @@ BOOST_PARAMETER_FUNCTION(
             (docstring, (char const*), "")
     
             (keywords
    -           , *(is_keyword_expression<mpl::_>) // see5
    +           , *(is_keyword_expression<mpl::_>) // see5
                , no_keywords())
     
             (policies
                , *(mpl::not_<
                      mpl::or_<
                          boost::is_convertible<mpl::_, char const*>
    -                   , is_keyword_expression<mpl::_> // see5
    +                   , is_keyword_expression<mpl::_> // see5
                      >
                  >)
                , default_call_policies()
    @@ -1023,9 +987,9 @@ void f()
     ''') -->
     

    Syntax Note

    -

    A (deduced …) clause always contains a ``(required …)`` -and/or an ``(optional …)`` subclause, and must follow any -(required …) or ``(optional …)`` clauses indicating +

    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:

    @@ -1049,8 +1013,8 @@ def(
    -
    -

    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 @@ -1094,18 +1058,18 @@ BOOST_PARAMETER_NAME(arg1) BOOST_PARAMETER_NAME(arg2)''') -->

    -
    -

    2.3   Parameter-Enabled Constructors

    +
    +

    2.3   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) +(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 a base class.

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

    @@ -1152,12 +1116,12 @@ myclass z("june"); // positional/defaulted -

    For more on ArgumentPack manipulation, see the Advanced Topics +

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

    -
    -

    2.4   Parameter-Enabled Class Templates

    -

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

    +
    +

    2.4   Parameter-Enabled Class Templates

    +

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

     template class<
         ValueType, BaseList = bases<>
    @@ -1167,8 +1131,8 @@ class class_;
     

    Only the first argument, ValueType, is required.

    -
    -

    2.4.1   Named Template Parameters

    +
    +

    2.4.1   Named Template Parameters

    First, we'll build an interface that allows users to pass arguments positionally or by name:

    @@ -1184,8 +1148,8 @@ class_<
     > …;
     
    -
    -

    2.4.1.1   Template Keywords

    +
    +

    2.4.1.1   Template Keywords

    The first step is to define keywords for each template parameter:

     namespace boost { namespace python {
    @@ -1217,8 +1181,8 @@ struct class_type
     

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

    -
    -

    2.4.1.2   Class Template Skeleton

    +
    +

    2.4.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 @@ -1246,11 +1210,11 @@ struct class_

    -
    -

    2.4.1.3   Class Template Signatures

    -

    Next, we need to build a type, known as a ParameterSpec, +

    +

    2.4.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 +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):

    @@ -1289,10 +1253,10 @@ struct bases }}''') -->
    -
    -

    2.4.1.4   Argument Packs and Parameter Extraction

    +
    +

    2.4.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 binding< +into an ArgumentPack type, and then use the library's binding< > metafunction to extract “logical parameters”. Note that defaults are specified by supplying an optional third argument to binding< >:

    @@ -1330,8 +1294,8 @@ struct class_
    -
    -

    2.4.2   Exercising the Code So Far

    +
    +

    2.4.2   Exercising the Code So Far

    Revisiting our original examples,

    @@ -1371,12 +1335,12 @@ BOOST_MPL_ASSERT((boost::is_same<c2::copyable, void>));
     
    -
    -

    2.4.3   Deduced Template Parameters

    +
    +

    2.4.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 +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 @@ -1498,12 +1462,12 @@ BOOST_MPL_ASSERT((boost::is_same));''') -->

    -
    -

    3   Advanced Topics

    +
    +

    3   Advanced Topics

    At this point, you should have a good grasp of the basics. In this section we'll cover some more esoteric uses of the library.

    -
    -

    3.1   Fine-Grained Name Control

    +
    +

    3.1   Fine-Grained Name Control

    If you don't like the leading-underscore naming convention used to refer to keyword objects, or you need the name tag for something other than the keyword type namespace, there's another @@ -1531,17 +1495,17 @@ int main() {}''') -->

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

    +section on best practices for keyword object naming.

    -
    -

    3.2   More ArgumentPacks

    +
    +

    3.2   More ArgumentPacks

    We've already seen ArgumentPacks when we looked at -parameter-enabled constructors and class templates. As you +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

    +
    +

    3.2.1   Building ArgumentPacks

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

    @@ -1575,7 +1539,7 @@ int print_name_and_index(ArgumentPack const& args)
     int y = print_name_and_index((_index = 3, _name = "jones"));
     

    To build an ArgumentPack with positional arguments, we can use a -ParameterSpec. As introduced described in the section on Class +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< @@ -1606,11 +1570,11 @@ using boost::mpl::_;''') --> int main() {}''') --> -

    Note that because of the forwarding problem, parameter::parameters::operator() +

    Note that because of the forwarding problem, parameter::parameters::operator() can't accept non-const rvalues.

    -
    -

    3.2.2   Extracting Parameter Types

    +
    +

    3.2.2   Extracting Parameter Types

    If we want to know the types of the arguments passed to print_name_and_index, we have a couple of options. The simplest and least error-prone approach is to forward them to a @@ -1650,7 +1614,7 @@ int main() 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 binding< > metafunction introduced -earlier:

    +earlier:

     BOOST_PARAMETER_NAME(index)
     
    @@ -1675,7 +1639,7 @@ using boost::remove_reference;''') -->
     

    Note that the remove_reference< > dance is necessary because binding< > will return a reference type when the argument is bound in the argument pack. If we don't strip the reference we -end up returning a reference to the temporary created in the 2*… +end up returning a reference to the temporary created in the 2 * expression. A convenient shortcut would be to use the value_type< > metafunction:

    @@ -1689,6 +1653,7 @@ twice_index(ArgumentPack const& args)
     
    +
     
     
     
    -
    -

    3.2.3   Lazy Default Computation

    +
    +

    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 @@ -1796,13 +1761,13 @@ the caller.

    -
    -

    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

    +
    +

    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:

    @@ -1854,8 +1819,8 @@ beginning with leading underscores—which are reserved to your C++ compiler—might become irretrievably ambiguous with those in our unnamed namespace.

    -
    -

    4.2   Namespaces

    +
    +

    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:

    @@ -1958,8 +1923,8 @@ int y = lib::f(_name = "bob", _index = 2);
    -
    -

    4.3   Documentation

    +
    +

    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.

    @@ -1972,22 +1937,22 @@ sharing.

    -
    -

    5   Portability Considerations

    -

    Use the regression test results for the latest Boost release of +

    +

    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   No SFINAE Support

    +
    +

    5.1   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.2   No Support for result_of

    -

    Lazy default computation relies on the result_of class +

    +

    5.2   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 @@ -2026,8 +1991,8 @@ are unspecified, the workaround is to use .. |BOOST_PARAMETER_MATCH| replace:: ``BOOST_PARAMETER_MATCH`` -->

    -
    -

    5.3   Compiler Can't See References In Unnamed Namespace

    +
    +

    5.3   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 @@ -2047,18 +2012,18 @@ 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 +

    +

    7   Reference

    +

    Follow this link to the Boost.Parameter reference documentation.

    -
    -

    8   Glossary

    +
    +

    8   Glossary

    @@ -2087,8 +2052,8 @@ 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.

    @@ -2096,8 +2061,8 @@ especially our review manager, Doug Gregor.

    - @@ -2106,7 +2071,7 @@ backward-compatibility.
    [1]As of Boost 1.33.0 the Graph library was still -using an older named parameter mechanism, but there are +
    [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.
    - @@ -2114,7 +2079,7 @@ units (object files) that make up a program.
    [2]The One Definition Rule says that any given entity in +
    [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 +
    [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 @@ -2125,7 +2090,7 @@ library wouldn't suffer.
    - +
    [4]This is a major motivation behind ConceptC++.
    [4]This is a major motivation behind ConceptC++.
    @@ -2135,7 +2100,7 @@ library wouldn't suffer.
    - @@ -2144,7 +2109,7 @@ identify models of Boost.Python's KeywordExpression concept.
    [5](1, 2) Here we're assuming there's a predicate +
    [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.
    - diff --git a/doc/html/python.html b/doc/html/python.html index 5e26f13..8cace04 100644 --- a/doc/html/python.html +++ b/doc/html/python.html @@ -3,11 +3,11 @@ - +The Boost Parameter Library Python Binding Documentation - + @@ -21,16 +21,16 @@ - + - + - + +or copy at http://www.boost.org/LICENSE_1_0.txt)
    [6]

    You can always give the illusion that the function +

    [6]

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

       namespace foo_overloads
    @@ -2164,20 +2129,20 @@ lookup is due to Herb Sutter.
     
    -
    [7]This capability depends on your compiler's support for SFINAE. +
    [7]This capability depends on your compiler's support for SFINAE. SFINAE: Substitution Failure Is -Not An Error. If type substitution during the +Not An E rror. 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; +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 +http://www.semantics.org/once_weakly/w02_SFINAE.pdf for more information on SFINAE.
    @@ -2185,8 +2150,8 @@ information on SFINAE.
    Authors: Daniel Wallin
    Contact:dalwan01@student.umu.se
    dalwan01@student.umu.se
    Organization:Boost Consulting
    Boost Consulting
    Date:2006-12-14
    2008-03-22
    Copyright: Copyright David Abrahams, Daniel Wallin 2005. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt -or copy at http://www.boost.org/LICENSE_1_0.txt)
    -

    Boost

    -
    -

    Contents

    +

    Boost

    + -
    -

    Introduction

    -

    boost/parameter/python.hpp introduces a group of def_visitors that can +

    +

    Introduction

    +

    boost/parameter/python.hpp introduces a group of def_visitors that can be used to easily expose Boost.Parameter-enabled member functions to Python with Boost.Python. It also provides a function template def() that can be used to expose Boost.Parameter-enabled free functions.

    @@ -70,8 +70,8 @@ types. Additionally, ``boost::parameter::python::function`` and ``boost::parameter::python::def`` requires a class with forwarding overloads. We will take a closer look at how this is done in the tutorial section below. --> -

    The keyword tags and associated argument types are specified as an MPL -Sequence, using the function type syntax described in ParameterSpec +

    The keyword tags and associated argument types are specified as an MPL +Sequence, using the function type syntax described in ParameterSpec below. Additionally, boost::parameter::python::function and boost::parameter::python::def requires a class with forwarding overloads. We will take a closer look at how this is done in the tutorial section below.

    @@ -80,11 +80,11 @@ We will take a closer look at how this is done in the tutorial section below.

    -
    -

    Tutorial

    +
    +

    Tutorial

    In this section we will outline the steps needed to bind a simple Boost.Parameter-enabled member function to Python. Knowledge of the -Boost.Parameter macros are required to understand this section.

    +Boost.Parameter macros are required to understand this section.

    The class and member function we are interested in binding looks like this:

    @@ -121,7 +121,7 @@ assert(width == 400);
     

    It defines a set of overloaded member functions called open with one required parameter and two optional ones. To bind this member function to Python we use the binding utility boost::parameter::python::function. -boost::parameter::python::function is a def_visitor that we'll instantiate +boost::parameter::python::function is a def_visitor that we'll instantiate and pass to boost::python::class_::def().

    To use boost::parameter::python::function we first need to define a class with forwarding overloads. This is needed because window::open() @@ -151,7 +151,7 @@ needs to take three parameters as well.

    We only need one overload in the forwarding class, despite the fact that there are two optional parameters. There are special circumstances when several overload are needed; see -special keywords.

    +special keywords.

    Next we'll define the module and export the class:

    @@ -185,11 +185,11 @@ BOOST_PYTHON_MODULE(my_module)
     ) -->
     
     

    py::function is passed two parameters. The first one is the class with -forwarding overloads that we defined earlier. The second one is an MPL +forwarding overloads that we defined earlier. The second one is an MPL Sequence with the keyword tag types and argument types for the function specified as function types. The pointer syntax used in tag::width* and tag::height* means that the parameter is optional. The first element of -the MPL Sequence is the return type of the function, in this case void, +the MPL Sequence is the return type of the function, in this case void, which is passed as the first argument to operator() in the forwarding class.


    -
    -

    concept ParameterSpec

    +
    +

    concept ParameterSpec

    A ParameterSpec is a function type K(T) that describes both the keyword tag, K, and the argument type, T, for a parameter.

    K is either:

    @@ -253,8 +253,8 @@ types instead). -->
  • or, a special keyword of the form Tag**
  • where Tag is a keyword tag type, as used in a specialization -of boost::parameter::keyword.

    -

    The arity range for an MPL Sequence of ParameterSpec's is +of boost::parameter::keyword.

    +

    The arity range for an MPL Sequence of ParameterSpec's is defined as the closed range:

     [ mpl::size<S> - number of special keyword tags in S, mpl::size<S> ]
    @@ -263,8 +263,8 @@ defined as the closed range:

    the arity range of mpl::vector2<x(int),y*(int)> is [2,2] and the arity range of mpl::vector2<x(int),y**(int)> is [1,2].

    -
    -

    special keywords

    +
    +

    special keywords

    Sometimes it is desirable to have a default value for a parameter that differ in type from the parameter. This technique is useful for doing simple tag-dispatching based on the presence of a parameter. For example:

    @@ -323,15 +323,15 @@ type that is distinct from any color map that the user might supply.

    When binding the case outlined above, the default type for color will not be convertible to the parameter type. Therefore we need to tag the color keyword as a special keyword. This is done by specifying the tag as -tag::color** when binding the function (see concept ParameterSpec for +tag::color** when binding the function (see concept ParameterSpec for more details on the tagging). By doing this we tell the binding functions that it needs to generate two overloads, one with the color parameter present and one without. Had there been two special keywords, four overloads would need to be generated. The number of generated overloads is equal to 2N, where N is the number of special keywords.


    -
    -

    class template init

    +
    +

    class template init

    Defines a named parameter enabled constructor.

     template <class ParameterSpecs>
    @@ -345,10 +345,10 @@ struct init : python::def_visitor<init<ParameterSpecs> >
     };
     
    -
    -

    init requirements

    +
    +

    init requirements

      -
    • ParameterSpecs is an MPL sequence where each element is a +

    • ParameterSpecs is an MPL sequence where each element is a model of ParameterSpec.

    • For every N in [U,V], where [U,V] is the arity @@ -382,13 +382,13 @@ expressions:

    -
    -

    template <class CallPolicies> operator[](CallPolicies const&)

    +
    +

    template <class CallPolicies> operator[](CallPolicies const&)

    Returns a def_visitor equivalent to *this, except that it uses CallPolicies when creating the binding.

    -
    -

    Example

    +
    +

    Example

     #include <boost/parameter/keyword.hpp>
     #include <boost/parameter/preprocessor.hpp>
    @@ -446,8 +446,8 @@ assert(args[y | 1] == 1);
     

    -
    -

    class template call

    +
    +

    class template call

    Defines a __call__ operator, mapped to operator() in C++.

     template <class ParameterSpecs>
    @@ -461,10 +461,10 @@ struct call : python::def_visitor<call<ParameterSpecs> >
     };
     
    -
    -

    call requirements

    +
    +

    call requirements

      -
    • ParameterSpecs is an MPL sequence where each element +

    • ParameterSpecs is an MPL sequence where each element except the first models ParameterSpec. The first element is the result type of c(…).

    • @@ -499,13 +499,13 @@ instance of Class:

    -
    -

    template <class CallPolicies> operator[](CallPolicies const&)

    +
    +

    template <class CallPolicies> operator[](CallPolicies const&)

    Returns a def_visitor equivalent to *this, except that it uses CallPolicies when creating the binding.

    -
    -

    Example

    +
    +

    Example

     #include <boost/parameter/keyword.hpp>
     #include <boost/parameter/preprocessor.hpp>
    @@ -573,8 +573,8 @@ return 0;
     

    -
    -

    class template function

    +
    +

    class template function

    Defines a named parameter enabled member function.

     template <class Fwd, class ParameterSpecs>
    @@ -585,10 +585,10 @@ struct function : python::def_visitor<function<Fwd, ParameterSpecs> >
     };
     
    -
    -

    function requirements

    +
    +

    function requirements

      -
    • ParameterSpecs is an MPL sequence where each element +

    • ParameterSpecs is an MPL sequence where each element except the first models ParameterSpec. The first element is the result type of c.f(…), where f is the member function.

      @@ -625,8 +625,8 @@ are tagged arguments.

    -
    -

    Example

    +
    +

    Example

    This example exports a member function f(int x, int y = …) to Python. The sequence of ParameterSpec's mpl::vector2<tag::x(int), tag::y*(int)> has an arity range of [2,2], so we only need one forwarding overload.

    @@ -689,18 +689,18 @@ assert(y == 1);

    -
    -

    function template def

    +
    +

    function template def

    Defines a named parameter enabled free function in the current Python scope.

     template <class Fwd, class ParameterSpecs>
     void def(char const* name);
     
    -
    -

    def requirements

    +
    +

    def requirements

      -
    • ParameterSpecs is an MPL sequence where each element +

    • ParameterSpecs is an MPL sequence where each element except the first models ParameterSpec. The first element is the result type of f(…), where f is the function.

    • @@ -734,8 +734,8 @@ is the result type of f(…)
    -
    -

    Example

    +
    +

    Example

    This example exports a function f(int x, int y = …) to Python. The sequence of ParameterSpec's mpl::vector2<tag::x(int), tag::y*(int)> has an arity range of [2,2], so we only need one forwarding overload.

    @@ -771,16 +771,16 @@ BOOST_PYTHON_MODULE(…)
    -
    -

    Portability

    +
    +

    Portability

    The Boost.Parameter Python binding library requires partial template specialization.

    diff --git a/doc/html/reference.html b/doc/html/reference.html old mode 100755 new mode 100644 index fb21721..83c6495 --- a/doc/html/reference.html +++ b/doc/html/reference.html @@ -3,7 +3,7 @@ - + The Boost Parameter Library Reference Documentation @@ -22,103 +22,103 @@ David Abrahams
    Daniel Wallin Contact: -dave@boost-consulting.com, dalwan01@student.umu.se +dave@boost-consulting.com, dalwan01@student.umu.se Organization: -Boost Consulting +Boost Consulting Date: 2005-07-17 Copyright: Copyright David Abrahams, Daniel Wallin 2005. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt -or copy at http://www.boost.org/LICENSE_1_0.txt) +or copy at http://www.boost.org/LICENSE_1_0.txt) -

    Boost

    +

    Boost


    -
    -

    Contents

    +
    +

    Contents


    -
    -

    1   Preliminaries

    +
    +

    1   Preliminaries

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

    -
    -

    1.1   Namespaces

    +
    +

    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

    +
    +

    1.2   Exceptions

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

    -
    -

    1.3   Thread Safety

    +
    +

    1.3   Thread Safety

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

    +threads without synchronization.1

    -
    -

    1.4   Typography

    -

    Names written in sans serif type represent concepts.

    +
    +

    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.

    +

    The special character β represents the value of BOOST_PARAMETER_MAX_ARITY.


    -
    -

    2   Terminology

    +
    +

    2   Terminology

    keyword
    The name of a function parameter.
    @@ -136,15 +136,15 @@ 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 +

    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 @@ -153,17 +153,17 @@ reference whose value is

    tagged default
    -
    A tagged reference whose value represents the value of a +
    A tagged reference whose value represents the value of a default argument.
    tagged lazy default
    -
    A tagged reference whose value, when invoked with no +
    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 +
    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.
    @@ -171,29 +171,29 @@ type X is 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.

    +for example, “an ArgumentPack” can refer to a type that +models ArgumentPack or an object of such a type.


    -
    -

    3   Concepts

    -

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

    -
    -

    3.1   ArgumentPack

    -

    An ArgumentPack is a collection of tagged references to the +

    +

    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 consisting of the keyword tag types in its tagged references.

    -
    -

    Requirements

    +also a valid MPL Forward Sequence consisting of the keyword tag types in its tagged references.

    +
    +

    Requirements

    In the table below,

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

    @@ -217,7 +217,7 @@ will be propagated to the caller.

    binding<A,K>::type x contains an element b whose -keyword is K +keyword is K Returns b's value (by reference). @@ -225,7 +225,7 @@ reference). binding<A,L,D>::type none If x contains an element b whose -keyword is the same as u's, +keyword is the same as u's, returns b's value (by reference). Otherwise, returns u's value. @@ -233,14 +233,14 @@ reference). Otherwise, returns u lazy_binding<A,M,E>::type none If x contains an element b whose -keyword is the same as w's, +keyword is the same as w's, returns b's value (by reference). Otherwise, invokes w's value and returns the result. x, z Model of ArgumentPack none -Returns an ArgumentPack containing +Returns an ArgumentPack containing all the elements of both x and z. @@ -248,17 +248,17 @@ all the elements of both x
    -
    -

    3.2   ParameterSpec

    +
    +

    3.2   ParameterSpec

    A ParameterSpec describes the type requirements for arguments -corresponding to a given keyword and indicates whether the argument +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,

    @@ -278,33 +278,33 @@ argument type. In each row,

    - + - +
    ParameterSpec allowed forms and conditions of satisfaction
    no n/a
    optional<K,F>
    optional<K,F> no mpl::apply<F,A>::type::value is true.
    required<K,F>
    required<K,F> yes mpl::apply<F,A>::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
    @@ -312,22 +312,22 @@ arguments that will be matched by ArgumentPack operator=(T& value) const; - template <class T> ArgumentPack operator=(T const& value) const; + template <class T> ArgumentPack operator=(T& value) const; + template <class T> ArgumentPack operator=(T const& value) const; - template <class T> tagged default operator|(T& x) const; - template <class T> tagged default operator|(T const& x) const; + template <class T> tagged default operator|(T& x) const; + template <class T> tagged default operator|(T const& x) const; - template <class F> tagged lazy default operator||(F const&) const; + template <class F> tagged lazy default operator||(F const&) const; - static keyword<Tag>& get(); + static keyword<Tag>& get(); };
    operator=
    -template <class T> ArgumentPack operator=(T& value) const;
    -template <class T> ArgumentPack operator=(T const& value) const;
    +template <class T> ArgumentPack operator=(T& value) const;
    +template <class T> ArgumentPack operator=(T const& value) const;
     
    @@ -335,8 +335,8 @@ template <class T> - +
    Requires:nothing
    Returns:an ArgumentPack containing a single tagged reference to -value with keyword Tag
    Returns:an ArgumentPack containing a single tagged reference to +value with keyword Tag
    @@ -352,7 +352,7 @@ template <class T> tagged default operator|(T const& x) const -Returns:a tagged default with value x and keyword Tag. +Returns:a tagged default with value x and keyword Tag. @@ -367,9 +367,9 @@ template <class F> tagged lazy default operator||(F const& g) -Requires:g() is valid, with type boost::result_of<F()>::type.2 +Requires:g() is valid, with type boost::result_of<F()>::type.2 -Returns:a tagged lazy default with value g and keyword Tag. +Returns:a tagged lazy default with value g and keyword Tag. @@ -395,17 +395,17 @@ simultaneously.
    -
    -

    4.2   parameters

    +
    +

    4.2   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 +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
    @@ -414,28 +414,28 @@ template <class P0 = unspecified, class P1 = unspecified, struct parameters { template <class A0, class A1 = unspecified, …class Aβ = unspecified> - struct match + struct match { typedef … type; }; template <class A0> - ArgumentPack operator()(A0& a0) const; + ArgumentPack operator()(A0& a0) const; template <class A0, class A1> - ArgumentPack operator()(A0& a0, A1& a1) const; + ArgumentPack operator()(A0& a0, A1& a1) const; template <class A0, class A1, …class Aβ> - ArgumentPack operator()(A0& a0, A1& a1, …Aβ& aβ) const; + ArgumentPack operator()(A0& a0, A1& a1, …Aβ& aβ) const; }; - +
    Requires:P0, P1, … Pβ are models of ParameterSpec.
    Requires:P0, P1, … Pβ are models of ParameterSpec.
    @@ -446,29 +446,29 @@ follows, for any argument type A<
    let D0 the set [d0, …, dj] of all deduced parameter specs in [P0, …, Pβ]
    - +

    -
    if Ai is a result type of keyword<T>::operator=
    +
    if Ai is a result type of keyword<T>::operator=
    then
    Ki is T
    else
    -
    if some Aj where ji is a result type of keyword<T>::operator=
    +
    if some Aj where ji is a result type of keyword<T>::operator=
    or some Pj in ji is deduced
    then
    if some parameter spec dj in Di matches Ai
    then
    -
    Ki is dj's keyword tag type.
    +
    Ki is dj's keyword tag type.
    Di+1 is Di - [dj]
    else
    -
    Ki is Pi's keyword tag type.
    +
    Ki is Pi's keyword tag type.
    @@ -476,7 +476,7 @@ follows, for any argument type A<
    match
    -

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

    +

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

    @@ -492,12 +492,12 @@ every j in 0…β, either:

    • Pj is the unspecified default
    • or, Pj is a keyword tag type
    • -
    • or, Pj is optional <X,F> and either
        +
      • or, Pj is optional <X,F> and either
        • X is not Ki for any i,
        • or X is some Ki and mpl::apply<F,Ri>::type::value is true
      • -
      • or, Pj is required <X,F>, and
          +
        • or, Pj is required <X,F>, and
          • X is some Ki, and
          • mpl::apply<F,Ri>::type::value is true
          @@ -508,20 +508,20 @@ every j in 0…β, either:

          operator()
          -template <class A0> ArgumentPack operator()(A0 const& a0) const;
          +template <class A0> ArgumentPack operator()(A0 const& a0) const;
           
           
           
          -template <class A0, …class Aβ> ArgumentPack operator()(A0 const& a0, …Aβ const& aβ) const;
          +template <class A0, …class Aβ> ArgumentPack operator()(A0 const& a0, …Aβ const& aβ) const;
           
    - @@ -530,14 +530,14 @@ template <class A0, …class Aβ> -

    4.3   optional, required

    +
    +

    4.3   optional, required

    These templates describe the requirements on a function parameter.

    Returns:

    An ArgumentPack containing, for each ai,

    +
    Returns:

    An ArgumentPack containing, for each ai,

    - +
    Defined in:boost/parameter/parameters.hpp
    Defined in:boost/parameter/parameters.hpp
    @@ -546,7 +546,7 @@ template <class A0, …class Aβ> Specializations model: - ParameterSpecParameterSpec @@ -557,18 +557,18 @@ struct optional; template <class Tag, class Predicate = unspecified> struct required; -

    The default value of Predicate is an unspecified Metafunction that returns +

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

    -
    -

    4.4   deduced

    +
    +

    4.4   deduced

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

    - +
    Defined in:boost/parameter/parameters.hpp
    Defined in:boost/parameter/parameters.hpp
    @@ -579,19 +579,19 @@ struct deduced;

    -
    -

    5   Metafunctions

    -

    A Metafunction is conceptually a function that operates on, and +

    +

    5   Metafunctions

    +

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

    -
    -

    5.1   binding

    +
    +

    5.1   binding

    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 n:boost/parameter/binding.hpp
    Defined n:boost/parameter/binding.hpp
    @@ -606,22 +606,22 @@ struct binding -Requires:A is a model of ArgumentPack. +Requires:A is a model of ArgumentPack. -Returns:the reference type of the tagged reference in A -having keyword tag type K, if any. If no such tagged reference exists, returns D. +Returns:the reference type of the tagged reference in A +having keyword tag type K, if any. If no such tagged reference exists, returns D.
    -
    -

    5.2   lazy_binding

    -

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

    +
    +

    5.2   lazy_binding

    +

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

    - +
    Defined in:boost/parameter/binding.hpp
    Defined in:boost/parameter/binding.hpp
    @@ -636,23 +636,23 @@ struct lazy_binding -Requires:A is a model of ArgumentPack. +Requires:A is a model of ArgumentPack. -Returns:the reference type of the tagged reference in A -having keyword tag type K, if any. If no such tagged reference exists, returns boost::result_of<F()>::type.2 +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 n:boost/parameter/value_type.hpp
    Defined n:boost/parameter/value_type.hpp
    @@ -667,11 +667,11 @@ struct value_type -Requires:

    A is a model of ArgumentPack.

    +Requires:

    A is a model of ArgumentPack.

    -Returns:

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

    +Returns:

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

     typename remove_reference<
       typename binding<A, K, D>::type
    @@ -685,17 +685,17 @@ typename remove_reference<
     

    -
    -

    6   Code Generation Macros

    +
    +

    6   Code Generation Macros

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

    -
    -

    6.1   BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)

    +
    +

    6.1   BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)

    - +
    Defined in:boost/parameter/preprocessor.hpp
    Defined in:boost/parameter/preprocessor.hpp
    @@ -729,7 +729,7 @@ restriction ::= ('*' '(' lambda-expression

    name is any valid C++ identifier. default-value is any valid C++ expression. typename is the name of a type. -lambda-expression is an MPL lambda expression.

    +lambda-expression is an MPL lambda expression.

    @@ -813,25 +813,25 @@ ResultType boost_param_default_ ## __LINE__ ## name(
    -
    -

    6.2   BOOST_PARAMETER_MEMBER_FUNCTION(result,name,tag_namespace,arguments)

    +
    +

    6.2   BOOST_PARAMETER_MEMBER_FUNCTION(result,name,tag_namespace,arguments)

    - +
    Defined in:boost/parameter/preprocessor.hpp
    Defined in:boost/parameter/preprocessor.hpp

    See BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)

    -
    -

    6.3   BOOST_PARAMETER_CONSTRUCTOR(cls, impl, tag_namespace, arguments)

    + -
    -

    6.4   BOOST_PARAMETER_NAME(name)

    +
    +

    6.4   BOOST_PARAMETER_NAME(name)

    Declares a tag-type and keyword object.

    Expands to:

    If name is of the form:

    @@ -935,8 +935,8 @@ namespace tag = ::boost::parameter::keyword<tag::name>::instance;
    -
    -

    6.5   BOOST_PARAMETER_TEMPLATE_KEYWORD(name)

    +
    +

    6.5   BOOST_PARAMETER_TEMPLATE_KEYWORD(name)

    Expands to:

     namespace tag
    @@ -950,14 +950,14 @@ struct name
     {};
     
    -
    -

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

    +
    +

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

    Deprecated

    This macro has been deprecated in favor of BOOST_PARAMETER_FUNCTION.

    -

    Generates a sequence of forwarding function templates named +

    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.

    @@ -965,7 +965,7 @@ positional arguments.

    -Defined in:boost/parameter/macros.hpp +Defined in:boost/parameter/macros.hpp @@ -989,13 +989,13 @@ r name( return name_with_named_params(p(x1,x2,…xl)); } -template <class A1, class A2, …class Al, class A##BOOST_PP_INC(l)> +template <class A1, class A2, …class Al, class A##BOOST_PP_INC(l)> r name( A1 const& a1, A2 const& a2, …Al const& xl - , A##BOOST_PP_INC(l) const& x##BOOST_PP_INC(l) - , typename p::match<A1,A2,…Al,A##BOOST_PP_INC(l)>::type p = p()) + , A##BOOST_PP_INC(l) const& x##BOOST_PP_INC(l) + , typename p::match<A1,A2,…Al,A##BOOST_PP_INC(l)>::type p = p()) { - return name_with_named_params(p(x1,x2,…xl,x##BOOST_PP_INC(l))); + return name_with_named_params(p(x1,x2,…xl,x##BOOST_PP_INC(l))); } @@ -1011,21 +1011,21 @@ r name(
    -
    -

    6.7   BOOST_PARAMETER_KEYWORD(n,k)

    +
    +

    6.7   BOOST_PARAMETER_KEYWORD(n,k)

    Deprecated

    This macro has been deprecated in favor of BOOST_PARAMETER_NAME.

    -

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

    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
    @@ -1041,15 +1041,15 @@ namespace {
    -
    -

    6.8   BOOST_PARAMETER_MATCH(p,a,x)

    -

    Generates a defaulted parameter declaration for a forwarding +

    +

    6.8   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
    @@ -1057,7 +1057,7 @@ function.

    -Requires:

    a is a Boost.Preprocessor sequence +Requires:

    a is a Boost.Preprocessor sequence of the form

     (A0)(A1)…(An)
    @@ -1075,10 +1075,10 @@ typename p::match<A0,A1
    -
    -

    7   Configuration Macros

    -
    -

    7.1   BOOST_PARAMETER_MAX_ARITY

    +
    +

    7   Configuration Macros

    +
    +

    7.1   BOOST_PARAMETER_MAX_ARITY

    Determines the maximum number of arguments supported by the library. Will only be #defined by the library if it is not already #defined.

    @@ -1086,7 +1086,7 @@ already #defined.

    -Defined in:boost/parameter/config.hpp +Defined in:boost/parameter/config.hpp @@ -1100,15 +1100,15 @@ already #defined.

    -
    -

    8   Tutorial

    -

    Follow this link to the Boost.Parameter tutorial +

    +

    8   Tutorial

    +

    Follow this link to the Boost.Parameter tutorial documentation.


    -
    [1]References to tag objects may be initialized multiple +
    [1]References to tag objects may be initialized multiple times. This scenario can only occur in the presence of threading. Because the C++ standard doesn't consider threading, it doesn't explicitly allow or forbid multiple initialization of @@ -1119,8 +1119,8 @@ where it could make a difference.
    -
    [2](1, 2) Where BOOST_NO_RESULT_OF is #defined, -boost::result_of<F()>::type is replaced by +
    [2](1, 2) Where BOOST_NO_RESULT_OF is #defined, +boost::result_of<F()>::type is replaced by F::result_type.
    @@ -1128,8 +1128,8 @@ where it could make a difference.
    diff --git a/doc/index.rst b/doc/index.rst old mode 100755 new mode 100644 index b210911..48ed7b3 --- a/doc/index.rst +++ b/doc/index.rst @@ -86,7 +86,12 @@ __ ../../../../index.htm ------------------------------------- +[Note: this tutorial does not cover all details of the library. Please see also the `reference documentation`__\ ] + +__ reference.html + .. contents:: **Table of Contents** + :depth: 2 .. role:: concept :class: concept diff --git a/doc/reference.rst b/doc/reference.rst old mode 100755 new mode 100644 index ab05824..2e5bdf4 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -803,8 +803,8 @@ Expands to: return ##\ *tag-name*; } - typedef *implementation defined* _; - typedef *implementation defined* _1; + typedef *unspecified* _; + typedef *unspecified* _1; }; } @@ -824,8 +824,8 @@ Expands to: return ##\ *name*; } - typedef *implementation defined* _; - typedef *implementation defined* _1; + typedef *unspecified* _; + typedef *unspecified* _1; }; } diff --git a/include/boost/parameter/aux_/cast.hpp b/include/boost/parameter/aux_/cast.hpp old mode 100755 new mode 100644 index 5c55b66..c9d290d --- a/include/boost/parameter/aux_/cast.hpp +++ b/include/boost/parameter/aux_/cast.hpp @@ -5,6 +5,8 @@ #ifndef BOOST_PARAMETER_CAST_060902_HPP # define BOOST_PARAMETER_CAST_060902_HPP +# include + # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) # include diff --git a/include/boost/parameter/aux_/default.hpp b/include/boost/parameter/aux_/default.hpp old mode 100755 new mode 100644 index ee90b95..604da61 --- a/include/boost/parameter/aux_/default.hpp +++ b/include/boost/parameter/aux_/default.hpp @@ -4,7 +4,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #ifndef DEFAULT_050329_HPP -#define DEFAULT_050329_HPP +# define DEFAULT_050329_HPP + +# include namespace boost { namespace parameter { namespace aux { @@ -27,7 +29,7 @@ struct default_ // the user when resolving the value of the parameter with the // given keyword // -#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300) +# if BOOST_WORKAROUND(__EDG_VERSION__, <= 300) // These compilers need a little extra help with overload // resolution; we have empty_arg_list's operator[] accept a base // class to make that overload less preferable. @@ -48,8 +50,8 @@ struct lazy_default : lazy_default_base(x) {} }; -# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base -#else +# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base +# else template struct lazy_default { @@ -58,8 +60,8 @@ struct lazy_default {} DefaultComputer const& compute_default; }; -# define BOOST_PARAMETER_lazy_default_fallback lazy_default -#endif +# define BOOST_PARAMETER_lazy_default_fallback lazy_default +# endif }}} // namespace boost::parameter::aux diff --git a/include/boost/parameter/aux_/python/invoker.hpp b/include/boost/parameter/aux_/python/invoker.hpp old mode 100755 new mode 100644 index 57a585f..0e61d40 --- a/include/boost/parameter/aux_/python/invoker.hpp +++ b/include/boost/parameter/aux_/python/invoker.hpp @@ -8,6 +8,7 @@ # include # include # include +# include # include # include diff --git a/include/boost/parameter/aux_/set.hpp b/include/boost/parameter/aux_/set.hpp old mode 100755 new mode 100644 index 46c9374..1c4ccf5 --- a/include/boost/parameter/aux_/set.hpp +++ b/include/boost/parameter/aux_/set.hpp @@ -5,6 +5,8 @@ #ifndef BOOST_PARAMETER_SET_060912_HPP # define BOOST_PARAMETER_SET_060912_HPP +# include + # if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \ && !BOOST_WORKAROUND(__GNUC__, < 3) # include diff --git a/include/boost/parameter/aux_/tagged_argument.hpp b/include/boost/parameter/aux_/tagged_argument.hpp old mode 100755 new mode 100644 index 5687158..6248be2 --- a/include/boost/parameter/aux_/tagged_argument.hpp +++ b/include/boost/parameter/aux_/tagged_argument.hpp @@ -14,6 +14,7 @@ # include # include # include +# include # include namespace boost { namespace parameter { namespace aux { diff --git a/include/boost/parameter/macros.hpp b/include/boost/parameter/macros.hpp old mode 100755 new mode 100644 index b127121..83fbfb5 --- a/include/boost/parameter/macros.hpp +++ b/include/boost/parameter/macros.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #define BOOST_PARAMETER_FUN_TEMPLATE_HEAD1(n) \ template diff --git a/include/boost/parameter/preprocessor.hpp b/include/boost/parameter/preprocessor.hpp old mode 100755 new mode 100644 index 609a9b3..92a0ac8 --- a/include/boost/parameter/preprocessor.hpp +++ b/include/boost/parameter/preprocessor.hpp @@ -149,7 +149,8 @@ struct argument_pack , typename Parameters::deduced_list , tag_keyword_arg , mpl::false_ - >::type type; + >::type result; + typedef typename mpl::first::type type; }; # if 1 //BOOST_WORKAROUND(BOOST_MSVC, < 1300)