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 @@
- +| 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) | +or copy at http://www.boost.org/LICENSE_1_0.txt)
[Note: this tutorial does not cover all details of the library. Please see also the reference documentation]
+Table of Contents
In C++, arguments are normally given meaning by their positions -with respect to a parameter list: the first argument passed maps +
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.
-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);
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.
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;
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.
-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 -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.
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.
| graph | in | -Model of Incidence Graph and -Vertex List Graph | +Model of Incidence Graph and +Vertex List Graph | none - this argument is required. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| visitor | in | -Model of DFS Visitor | +Model of DFS Visitor | boost::dfs_visitor<>() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| root_vertex | @@ -377,7 +342,7 @@ type.||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| index_map | in | -Model of Readable Property Map + | Model of Readable Property Map with key type := graph's vertex descriptor and value type an integer type. | @@ -385,7 +350,7 @@ an integer type.|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color_map | in/out | -Model 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 KeywordsThe 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 graphsIt 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 FunctionNow 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.
- 2.1.5 Function Signatures+
+ 2.1.5 Function SignaturesFunction 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 ParametersRequired 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 ParametersOptional 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” ParametersWithin 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 ArgumentsWhen 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 EvaluationNote 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 OverloadingIn 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 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 RequirementsWe 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 RequirementsThe 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 ParametersTo 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()
''') -->
- 2.2 Parameter-Enabled Member Functions+
+
-2.2 Parameter-Enabled Member FunctionsThe 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 ConstructorsThe 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 ParametersFirst, 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 KeywordsThe first step is to define keywords for each template parameter:
namespace boost { namespace python {
@@ -1217,8 +1181,8 @@ struct class_type
- 2.4.1.2 Class Template Skeleton+
+
-2.4.1.2 Class Template SkeletonThe 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 ExtractionNext, 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 FarRevisiting 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 ParametersTo 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 TopicsAt 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 ControlIf 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 ArgumentPacksWe'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 ArgumentPacksThe 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 TypesIf 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;''') -->
-
3.2.3 Lazy Default Computation+
+
3.2.3 Lazy Default ComputationWhen 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 PracticesBy 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 NamingBOOST_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 NamespacesIn 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 DocumentationThe 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 SupportSome 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 NamespaceIf 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
- 9 Acknowledgements+
+ 9 AcknowledgementsThe 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.
@@ -38,24 +38,24 @@ or copy at http
-
-Makes it possible to bind Boost.Parameter-enabled functions, operators and constructors to Python.
-
+
+
+
-Contents
- 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+
+
TutorialIn 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); Next we'll define the module and export the class: @@ -185,11 +185,11 @@ BOOST_PYTHON_MODULE(my_module) ) --> -
- concept ParameterSpec+
+
-concept ParameterSpecA 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). -->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 keywordsSometimes 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 initDefines a named parameter enabled constructor. template <class ParameterSpecs> @@ -345,10 +345,10 @@ struct init : python::def_visitor<init<ParameterSpecs> > };-
- init requirements+
+
-init requirements
- 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 callDefines 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
- 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 functionDefines 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
-
Example+
+
ExampleThis 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 defDefines 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
-
-Example+
+
ExampleThis 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(…)
-
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 @@
-
+
Portability+
+
PortabilityThe Boost.Parameter Python binding library requires partial template specialization. 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) | -
-
+
+
Contents
-
- 1 Preliminaries+
+ 1 PreliminariesThis section covers some basic information you'll need to know in order to understand this reference -
- 1.1 Namespaces+
+
-1.1 NamespacesIn this document, all unqualified identifiers should be assumed to be defined in namespace boost::parameter unless otherwise specified.
- 1.2 Exceptions+
+
-1.2 ExceptionsNo operation described in this document throws an exception unless otherwise specified.
- 1.3 Thread Safety+
+
-1.3 Thread SafetyAll 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
-
- 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. +
+ RequirementsIn 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. |
-
3.2 ParameterSpec+
+
3.2 ParameterSpecA 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,
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.
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. |
|
-
| Defined in: | boost/parameter/parameters.hpp | +
|---|---|
| Defined in: | boost/parameter/parameters.hpp |
| Requires: | P0, P1, … Pβ are models of ParameterSpec. | +
|---|---|
| Requires: | P0, P1, … Pβ are models of ParameterSpec. |
@@ -476,7 +476,7 @@ follows, for any argument type A<let D0 the set [d0, …, dj] of all deduced parameter specs in [P0, …, Pβ]- +- +thenKi is Telse- +or some Pj in j≤i is deducedthenif some parameter spec dj in Di matches Aithenelse- +
A Metafunction used to remove a forwarding function from overload resolution.
+A Metafunction used to remove a forwarding function from overload resolution.
| Defined in: | boost/parameter/parameters.hpp | +
|---|---|
| Defined in: | boost/parameter/parameters.hpp |
A Metafunction is conceptually a function that operates on, and +
A Metafunction is conceptually a function that operates on, and returns, C++ types.
-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 |
Returns the result type of indexing an argument pack with a tagged lazy default.
+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 |
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 |
A is a model of ArgumentPack.
+A is a model of ArgumentPack.
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:
+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)
@@ -729,7 +729,7 @@ restriction ::= ('*' '(' lambda-expression
- Defined in: boost/parameter/preprocessor.hpp +Defined in: boost/parameter/preprocessor.hpp 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.
| Defined in: | boost/parameter/preprocessor.hpp | +
|---|---|
| Defined in: | boost/parameter/preprocessor.hpp |
See BOOST_PARAMETER_FUNCTION(result,name,tag_namespace,arguments)
| Defined in: | boost/parameter/preprocessor.hpp | +
|---|---|
| Defined in: | boost/parameter/preprocessor.hpp |
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;Expands to:
namespace tag
@@ -950,14 +950,14 @@ struct name
{};
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.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 |
Generates a defaulted parameter declaration for a forwarding
+ Generates a defaulted parameter declaration for a forwarding
function. a is a Boost.Preprocessor sequence
+ a is a Boost.Preprocessor sequence
of the form Determines the maximum number of arguments supported by the
library. Will only be #defined by the library if it is not
already #defined. Follow this link to the Boost.Parameter tutorial
+ Follow this link to the Boost.Parameter tutorial
documentation.6.8 BOOST_PARAMETER_MATCH(p,a,x)
+
@@ -1057,7 +1057,7 @@ function.
Defined in: boost/parameter/match.hpp
+Defined in: boost/parameter/match.hpp
Requires: Requires:
(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
Defined in: boost/parameter/config.hpp
+
@@ -1100,15 +1100,15 @@ already #defined.
Defined in: boost/parameter/config.hpp
8 Tutorial
-8 Tutorial
+
[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.
@@ -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 [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.