mirror of
https://github.com/boostorg/parameter.git
synced 2026-01-19 16:32:13 +00:00
Compare commits
124 Commits
boost-1.34
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b116b8da99 | ||
|
|
834f245953 | ||
|
|
ef9dfeb2d1 | ||
|
|
98bcbbad78 | ||
|
|
d9f0e42397 | ||
|
|
0a26a05500 | ||
|
|
2e725894c6 | ||
|
|
a4b2742095 | ||
|
|
2af6d0439e | ||
|
|
276d786ed9 | ||
|
|
7689b5b9d0 | ||
|
|
a28883d9ad | ||
|
|
45bac7b579 | ||
|
|
e4e6ba52c4 | ||
|
|
6bb4b0ef8b | ||
|
|
e0416b8343 | ||
|
|
f8a1b652bc | ||
|
|
f7611b8a1f | ||
|
|
493a8b28a5 | ||
|
|
32ec272b6d | ||
|
|
4c8c0cce93 | ||
|
|
8fc7ba81cc | ||
|
|
5b2b1a47f8 | ||
|
|
f3764c539e | ||
|
|
b67fbdff8f | ||
|
|
0e263f5602 | ||
|
|
3c815b31fe | ||
|
|
dbbe37b8c1 | ||
|
|
ce712b8f30 | ||
|
|
913fa2eb44 | ||
|
|
12c873d3e4 | ||
|
|
164c48c018 | ||
|
|
2ac8833532 | ||
|
|
6556e278c6 | ||
|
|
1a9e89cb8d | ||
|
|
6d53a2b914 | ||
|
|
c7296b9a05 | ||
|
|
6a5d61ce3c | ||
|
|
e887f199e0 | ||
|
|
e7bd42b07a | ||
|
|
b9248d774f | ||
|
|
763a09c5aa | ||
|
|
07987bc97c | ||
|
|
b59c238a83 | ||
|
|
9dfa5a8d9e | ||
|
|
3d0bdf694c | ||
|
|
b5c6e05ea0 | ||
|
|
cc2a478afc | ||
|
|
1dab8a1008 | ||
|
|
4facdaafc3 | ||
|
|
5190f65321 | ||
|
|
0335832574 | ||
|
|
b9f287ea52 | ||
|
|
28f98ecbf0 | ||
|
|
4e8c8ced0f | ||
|
|
5baef32925 | ||
|
|
cc8ca29980 | ||
|
|
e2405e2d00 | ||
|
|
1cba9bd634 | ||
|
|
e58e928af4 | ||
|
|
c3e842fc4c | ||
|
|
ab57984c04 | ||
|
|
a8dc2bbd25 | ||
|
|
bb838edb2f | ||
|
|
74b777612e | ||
|
|
ea4457878c | ||
|
|
1f3fb08086 | ||
|
|
702ca6af6e | ||
|
|
225a38b68a | ||
|
|
de756246e7 | ||
|
|
de67d5fe6d | ||
|
|
40332972ca | ||
|
|
47292301e7 | ||
|
|
7a5a21dacc | ||
|
|
04aaeef41d | ||
|
|
5a0bad4224 | ||
|
|
07f167eed3 | ||
|
|
b34aa49ceb | ||
|
|
f5dbd06b32 | ||
|
|
9bcd7c2fec | ||
|
|
7f2abce0d4 | ||
|
|
b7036ee04f | ||
|
|
36d25230e6 | ||
|
|
d298a327b5 | ||
|
|
8162166037 | ||
|
|
dbcf8de808 | ||
|
|
07893af4c5 | ||
|
|
2070231553 | ||
|
|
5b1971f1ef | ||
|
|
988bb4b365 | ||
|
|
64bfddc3a7 | ||
|
|
2a0397c1b2 | ||
|
|
decd9ac9fd | ||
|
|
a181afc699 | ||
|
|
a6db5788f6 | ||
|
|
d37e7cd513 | ||
|
|
6dd64214c2 | ||
|
|
96d3e0fd07 | ||
|
|
ac398b0e50 | ||
|
|
3f1f0657f6 | ||
|
|
abae0c8d21 | ||
|
|
892a599999 | ||
|
|
acbf69fdb6 | ||
|
|
566e886887 | ||
|
|
ae05e30eac | ||
|
|
310998435c | ||
|
|
647265bfd3 | ||
|
|
76af708b1f | ||
|
|
deb606ef59 | ||
|
|
721b294842 | ||
|
|
f40418cf9a | ||
|
|
b12dbd9f6a | ||
|
|
6087feef11 | ||
|
|
e7d652f208 | ||
|
|
51c3dd4cb1 | ||
|
|
8cf35658bd | ||
|
|
ee2b252418 | ||
|
|
45d320a434 | ||
|
|
76067ad5d2 | ||
|
|
15b0729181 | ||
|
|
23d30d9ea6 | ||
|
|
012e0abd22 | ||
|
|
225ee5072e | ||
|
|
384add2571 |
0
doc/Jamfile.v2
Executable file → Normal file
0
doc/Jamfile.v2
Executable file → Normal file
0
doc/html/index.html
Executable file → Normal file
0
doc/html/index.html
Executable file → Normal file
@@ -7,7 +7,7 @@
|
||||
<title>The Boost Parameter Library Python Binding Documentation</title>
|
||||
<meta name="authors" content="Daniel Wallin" />
|
||||
<meta name="organization" content="Boost Consulting" />
|
||||
<meta name="date" content="2006-09-21" />
|
||||
<meta name="date" content="2006-12-14" />
|
||||
<meta name="copyright" content="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)" />
|
||||
<link rel="stylesheet" href="rst.css" type="text/css" />
|
||||
</head>
|
||||
@@ -25,7 +25,7 @@
|
||||
<tr><th class="docinfo-name">Organization:</th>
|
||||
<td><a class="first last reference" href="http://www.boost-consulting.com">Boost Consulting</a></td></tr>
|
||||
<tr><th class="docinfo-name">Date:</th>
|
||||
<td>2006-09-21</td></tr>
|
||||
<td>2006-12-14</td></tr>
|
||||
<tr><th class="docinfo-name">Copyright:</th>
|
||||
<td>Copyright David Abrahams, Daniel Wallin
|
||||
2005. Distributed under the Boost Software License,
|
||||
@@ -42,19 +42,19 @@ functions, operators and constructors to Python.</p>
|
||||
<div class="contents topic">
|
||||
<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference" href="#introduction" id="id8" name="id8">Introduction</a></li>
|
||||
<li><a class="reference" href="#tutorial" id="id9" name="id9">Tutorial</a></li>
|
||||
<li><a class="reference" href="#concept-parameterspec" id="id10" name="id10">concept <span class="concept">ParameterSpec</span></a></li>
|
||||
<li><a class="reference" href="#special-keywords" id="id11" name="id11"><em>special</em> keywords</a></li>
|
||||
<li><a class="reference" href="#class-template-init" id="id12" name="id12">class template <tt class="docutils literal"><span class="pre">init</span></tt></a></li>
|
||||
<li><a class="reference" href="#class-template-call" id="id13" name="id13">class template <tt class="docutils literal"><span class="pre">call</span></tt></a></li>
|
||||
<li><a class="reference" href="#class-template-function" id="id14" name="id14">class template <tt class="docutils literal"><span class="pre">function</span></tt></a></li>
|
||||
<li><a class="reference" href="#function-template-def" id="id15" name="id15">function template <tt class="docutils literal"><span class="pre">def</span></tt></a></li>
|
||||
<li><a class="reference" href="#portability" id="id16" name="id16">Portability</a></li>
|
||||
<li><a class="reference" href="#introduction" id="id7" name="id7">Introduction</a></li>
|
||||
<li><a class="reference" href="#tutorial" id="id8" name="id8">Tutorial</a></li>
|
||||
<li><a class="reference" href="#concept-parameterspec" id="id9" name="id9">concept <span class="concept">ParameterSpec</span></a></li>
|
||||
<li><a class="reference" href="#special-keywords" id="id10" name="id10"><em>special</em> keywords</a></li>
|
||||
<li><a class="reference" href="#class-template-init" id="id11" name="id11">class template <tt class="docutils literal"><span class="pre">init</span></tt></a></li>
|
||||
<li><a class="reference" href="#class-template-call" id="id12" name="id12">class template <tt class="docutils literal"><span class="pre">call</span></tt></a></li>
|
||||
<li><a class="reference" href="#class-template-function" id="id13" name="id13">class template <tt class="docutils literal"><span class="pre">function</span></tt></a></li>
|
||||
<li><a class="reference" href="#function-template-def" id="id14" name="id14">function template <tt class="docutils literal"><span class="pre">def</span></tt></a></li>
|
||||
<li><a class="reference" href="#portability" id="id15" name="id15">Portability</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id8" id="introduction" name="introduction">Introduction</a></h1>
|
||||
<h1><a class="toc-backref" href="#id7" id="introduction" name="introduction">Introduction</a></h1>
|
||||
<p><tt class="docutils literal"><span class="pre">boost/parameter/python.hpp</span></tt> introduces a group of <a class="reference" href="../../../python/doc/v2/def_visitor.html"><tt class="docutils literal"><span class="pre">def_visitors</span></tt></a> that can
|
||||
be used to easily expose Boost.Parameter-enabled member functions to Python with
|
||||
Boost.Python. It also provides a function template <tt class="docutils literal"><span class="pre">def()</span></tt> that can be used
|
||||
@@ -81,7 +81,7 @@ We will take a closer look at how this is done in the tutorial section below.</p
|
||||
<!-- function? -->
|
||||
</div>
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id9" id="tutorial" name="tutorial">Tutorial</a></h1>
|
||||
<h1><a class="toc-backref" href="#id8" id="tutorial" name="tutorial">Tutorial</a></h1>
|
||||
<p>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 <a class="reference" href="index.html">macros</a> are required to understand this section.</p>
|
||||
@@ -124,7 +124,8 @@ Python we use the binding utility <tt class="docutils literal"><span class="pre"
|
||||
<tt class="docutils literal"><span class="pre">boost::parameter::python::function</span></tt> is a <a class="reference" href="../../../python/doc/v2/def_visitor.html"><tt class="docutils literal"><span class="pre">def_visitor</span></tt></a> that we'll instantiate
|
||||
and pass to <tt class="docutils literal"><span class="pre">boost::python::class_::def()</span></tt>.</p>
|
||||
<p>To use <tt class="docutils literal"><span class="pre">boost::parameter::python::function</span></tt> we first need to define
|
||||
a class with forwarding overloads.</p>
|
||||
a class with forwarding overloads. This is needed because <tt class="docutils literal"><span class="pre">window::open()</span></tt>
|
||||
is a function template, so we can't refer to it in any other way.</p>
|
||||
<pre class="literal-block">
|
||||
struct open_fwd
|
||||
{
|
||||
@@ -188,7 +189,9 @@ forwarding overloads that we defined earlier. The second one is an <a class="ref
|
||||
Sequence</a> with the keyword tag types and argument types for the function
|
||||
specified as function types. The pointer syntax used in <tt class="docutils literal"><span class="pre">tag::width*</span></tt> and
|
||||
<tt class="docutils literal"><span class="pre">tag::height*</span></tt> means that the parameter is optional. The first element of
|
||||
the <a class="reference" href="../../../mpl/doc/refmanual/sequences.html">MPL Sequence</a> is the return type of the function, in this case <tt class="docutils literal"><span class="pre">void</span></tt>.</p>
|
||||
the <a class="reference" href="../../../mpl/doc/refmanual/sequences.html">MPL Sequence</a> is the return type of the function, in this case <tt class="docutils literal"><span class="pre">void</span></tt>,
|
||||
which is passed as the first argument to <tt class="docutils literal"><span class="pre">operator()</span></tt> in the forwarding
|
||||
class.</p>
|
||||
<!-- The
|
||||
pointer syntax means that the parameter is optional, so in this case
|
||||
``width`` and ``height`` are optional parameters. The third parameter
|
||||
@@ -240,7 +243,7 @@ types instead). -->
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id10" id="concept-parameterspec" name="concept-parameterspec">concept <span class="concept">ParameterSpec</span></a></h1>
|
||||
<h1><a class="toc-backref" href="#id9" id="concept-parameterspec" name="concept-parameterspec">concept <span class="concept">ParameterSpec</span></a></h1>
|
||||
<p>A <span class="concept">ParameterSpec</span> is a function type <tt class="docutils literal"><span class="pre">K(T)</span></tt> that describes both the keyword tag,
|
||||
<tt class="docutils literal"><span class="pre">K</span></tt>, and the argument type, <tt class="docutils literal"><span class="pre">T</span></tt>, for a parameter.</p>
|
||||
<p><tt class="docutils literal"><span class="pre">K</span></tt> is either:</p>
|
||||
@@ -261,11 +264,12 @@ the <strong>arity range</strong> of <tt class="docutils literal"><span class="pr
|
||||
<strong>arity range</strong> of <tt class="docutils literal"><span class="pre">mpl::vector2<x(int),y**(int)></span></tt> is <tt class="docutils literal"><span class="pre">[1,2]</span></tt>.</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id11" id="special-keywords" name="special-keywords"><em>special</em> keywords</a></h1>
|
||||
<h1><a class="toc-backref" href="#id10" id="special-keywords" name="special-keywords"><em>special</em> keywords</a></h1>
|
||||
<p>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. An <a class="reference" href="index.html#dispatching-based-on-the-presence-of-a-default">example</a> of this is given in the Boost.Parameter
|
||||
docs. The example uses a different technique, but could also have been written like this:</p>
|
||||
based on the presence of a parameter. For example:</p>
|
||||
<!-- An example_ of this is given in the Boost.Parameter
|
||||
docs. The example uses a different technique, but could also have been written like this: -->
|
||||
<pre class="literal-block">
|
||||
namespace core
|
||||
{
|
||||
@@ -313,19 +317,21 @@ int main()
|
||||
depth_first_search(params()(color = 0));
|
||||
}''') -->
|
||||
<!-- @build() -->
|
||||
<!-- .. _example: index.html#dispatching-based-on-the-presence-of-a-default -->
|
||||
<p>In the above example the type of the default for <tt class="docutils literal"><span class="pre">color</span></tt> is <tt class="docutils literal"><span class="pre">mpl::false_</span></tt>, a
|
||||
type that is distinct from any color map that the user might supply.</p>
|
||||
<p>When binding the case outlined above, the default type for <tt class="docutils literal"><span class="pre">color</span></tt> will not
|
||||
be convertible to the parameter type. Therefore we need to tag the <tt class="docutils literal"><span class="pre">color</span></tt>
|
||||
keyword as a <em>special</em> keyword. By doing this we tell the binding functions
|
||||
that it needs to generate two overloads, one with the <tt class="docutils literal"><span class="pre">color</span></tt> parameter
|
||||
present and one without. Had there been two <em>special</em> keywords, four
|
||||
overloads would need to be generated. The number of generated overloads is
|
||||
equal to 2<sup>N</sup>, where <tt class="docutils literal"><span class="pre">N</span></tt> is the number of <em>special</em> keywords.</p>
|
||||
keyword as a <em>special</em> keyword. This is done by specifying the tag as
|
||||
<tt class="docutils literal"><span class="pre">tag::color**</span></tt> when binding the function (see <a class="reference" href="#concept-parameterspec">concept ParameterSpec</a> for
|
||||
more details on the tagging). By doing this we tell the binding functions that
|
||||
it needs to generate two overloads, one with the <tt class="docutils literal"><span class="pre">color</span></tt> parameter present
|
||||
and one without. Had there been two <em>special</em> keywords, four overloads would
|
||||
need to be generated. The number of generated overloads is equal to 2<sup>N</sup>, where <tt class="docutils literal"><span class="pre">N</span></tt> is the number of <em>special</em> keywords.</p>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id12" id="class-template-init" name="class-template-init">class template <tt class="docutils literal"><span class="pre">init</span></tt></a></h1>
|
||||
<h1><a class="toc-backref" href="#id11" id="class-template-init" name="class-template-init">class template <tt class="docutils literal"><span class="pre">init</span></tt></a></h1>
|
||||
<p>Defines a named parameter enabled constructor.</p>
|
||||
<pre class="literal-block">
|
||||
template <class ParameterSpecs>
|
||||
@@ -348,7 +354,7 @@ model of <span class="concept">ParameterSpec</span>.</p>
|
||||
<li><p class="first">For every <tt class="docutils literal"><span class="pre">N</span></tt> in <tt class="docutils literal"><span class="pre">[U,V]</span></tt>, where <tt class="docutils literal"><span class="pre">[U,V]</span></tt> is the <strong>arity
|
||||
range</strong> of <tt class="docutils literal"><span class="pre">ParameterSpecs</span></tt>, <tt class="docutils literal"><span class="pre">Class</span></tt> must support these
|
||||
expressions:</p>
|
||||
<table border="1" class="docutils table">
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="30%" />
|
||||
<col width="17%" />
|
||||
@@ -382,7 +388,7 @@ expressions:</p>
|
||||
uses CallPolicies when creating the binding.</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="id3" name="id3">Example</a></h2>
|
||||
<h2><a id="example" name="example">Example</a></h2>
|
||||
<pre class="literal-block">
|
||||
#include <boost/parameter/keyword.hpp>
|
||||
#include <boost/parameter/preprocessor.hpp>
|
||||
@@ -441,7 +447,7 @@ assert(args[y | 1] == 1);
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id13" id="class-template-call" name="class-template-call">class template <tt class="docutils literal"><span class="pre">call</span></tt></a></h1>
|
||||
<h1><a class="toc-backref" href="#id12" id="class-template-call" name="class-template-call">class template <tt class="docutils literal"><span class="pre">call</span></tt></a></h1>
|
||||
<p>Defines a <tt class="docutils literal"><span class="pre">__call__</span></tt> operator, mapped to <tt class="docutils literal"><span class="pre">operator()</span></tt> in C++.</p>
|
||||
<pre class="literal-block">
|
||||
template <class ParameterSpecs>
|
||||
@@ -464,7 +470,7 @@ is the result type of <tt class="docutils literal"><span class="pre">c(…)</spa
|
||||
</li>
|
||||
<li><p class="first"><tt class="docutils literal"><span class="pre">Class</span></tt> must support these expressions, where <tt class="docutils literal"><span class="pre">c</span></tt> is an
|
||||
instance of <tt class="docutils literal"><span class="pre">Class</span></tt>:</p>
|
||||
<table border="1" class="docutils table">
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="24%" />
|
||||
<col width="26%" />
|
||||
@@ -494,12 +500,12 @@ instance of <tt class="docutils literal"><span class="pre">Class</span></tt>:</p
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="id4" name="id4"><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">CallPolicies></span> <span class="pre">operator[](CallPolicies</span> <span class="pre">const&)</span></tt></a></h2>
|
||||
<h2><a id="id3" name="id3"><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">CallPolicies></span> <span class="pre">operator[](CallPolicies</span> <span class="pre">const&)</span></tt></a></h2>
|
||||
<p>Returns a <tt class="docutils literal"><span class="pre">def_visitor</span></tt> equivalent to <tt class="docutils literal"><span class="pre">*this</span></tt>, except that it
|
||||
uses CallPolicies when creating the binding.</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="id5" name="id5">Example</a></h2>
|
||||
<h2><a id="id4" name="id4">Example</a></h2>
|
||||
<pre class="literal-block">
|
||||
#include <boost/parameter/keyword.hpp>
|
||||
#include <boost/parameter/preprocessor.hpp>
|
||||
@@ -568,7 +574,7 @@ return 0;
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id14" id="class-template-function" name="class-template-function">class template <tt class="docutils literal"><span class="pre">function</span></tt></a></h1>
|
||||
<h1><a class="toc-backref" href="#id13" id="class-template-function" name="class-template-function">class template <tt class="docutils literal"><span class="pre">function</span></tt></a></h1>
|
||||
<p>Defines a named parameter enabled member function.</p>
|
||||
<pre class="literal-block">
|
||||
template <class Fwd, class ParameterSpecs>
|
||||
@@ -588,7 +594,7 @@ is the result type of <tt class="docutils literal"><span class="pre">c.f(…)</s
|
||||
function.</p>
|
||||
</li>
|
||||
<li><p class="first">An instance of <tt class="docutils literal"><span class="pre">Fwd</span></tt> must support this expression:</p>
|
||||
<table border="1" class="docutils table">
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="39%" />
|
||||
<col width="18%" />
|
||||
@@ -620,7 +626,7 @@ are tagged arguments.</p>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="id6" name="id6">Example</a></h2>
|
||||
<h2><a id="id5" name="id5">Example</a></h2>
|
||||
<p>This example exports a member function <tt class="docutils literal"><span class="pre">f(int</span> <span class="pre">x,</span> <span class="pre">int</span> <span class="pre">y</span> <span class="pre">=</span> <span class="pre">…)</span></tt> to Python. The
|
||||
sequence of <span class="concept">ParameterSpec</span>'s <tt class="docutils literal"><span class="pre">mpl::vector2<tag::x(int),</span> <span class="pre">tag::y*(int)></span></tt> has
|
||||
an <strong>arity range</strong> of [2,2], so we only need one forwarding overload.</p>
|
||||
@@ -684,7 +690,7 @@ assert(y == 1);
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id15" id="function-template-def" name="function-template-def">function template <tt class="docutils literal"><span class="pre">def</span></tt></a></h1>
|
||||
<h1><a class="toc-backref" href="#id14" id="function-template-def" name="function-template-def">function template <tt class="docutils literal"><span class="pre">def</span></tt></a></h1>
|
||||
<p>Defines a named parameter enabled free function in the current Python scope.</p>
|
||||
<pre class="literal-block">
|
||||
template <class Fwd, class ParameterSpecs>
|
||||
@@ -699,7 +705,7 @@ except the first models <span class="concept">ParameterSpec</span>. The first el
|
||||
is the result type of <tt class="docutils literal"><span class="pre">f(…)</span></tt>, where <tt class="docutils literal"><span class="pre">f</span></tt> is the function.</p>
|
||||
</li>
|
||||
<li><p class="first">An instance of <tt class="docutils literal"><span class="pre">Fwd</span></tt> must support this expression:</p>
|
||||
<table border="1" class="docutils table">
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="39%" />
|
||||
<col width="21%" />
|
||||
@@ -729,7 +735,7 @@ is the result type of <tt class="docutils literal"><span class="pre">f(…)</spa
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="id7" name="id7">Example</a></h2>
|
||||
<h2><a id="id6" name="id6">Example</a></h2>
|
||||
<p>This example exports a function <tt class="docutils literal"><span class="pre">f(int</span> <span class="pre">x,</span> <span class="pre">int</span> <span class="pre">y</span> <span class="pre">=</span> <span class="pre">…)</span></tt> to Python. The
|
||||
sequence of <span class="concept">ParameterSpec</span>'s <tt class="docutils literal"><span class="pre">mpl::vector2<tag::x(int),</span> <span class="pre">tag::y*(int)></span></tt> has
|
||||
an <strong>arity range</strong> of [2,2], so we only need one forwarding overload.</p>
|
||||
@@ -766,14 +772,14 @@ BOOST_PYTHON_MODULE(…)
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id16" id="portability" name="portability">Portability</a></h1>
|
||||
<h1><a class="toc-backref" href="#id15" id="portability" name="portability">Portability</a></h1>
|
||||
<p>The Boost.Parameter Python binding library requires <em>partial template
|
||||
specialization</em>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<hr class="footer" />
|
||||
Generated on: 2007-01-03 17:02 UTC.
|
||||
Generated on: 2007-01-03 16:40 UTC.
|
||||
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
|
||||
|
||||
</div>
|
||||
|
||||
0
doc/html/reference.html
Executable file → Normal file
0
doc/html/reference.html
Executable file → Normal file
0
doc/html/rst.css
Executable file → Normal file
0
doc/html/rst.css
Executable file → Normal file
0
doc/html/vellipsis.gif
Executable file → Normal file
0
doc/html/vellipsis.gif
Executable file → Normal file
|
Before Width: | Height: | Size: 62 B After Width: | Height: | Size: 62 B |
2
doc/index.rst
Executable file → Normal file
2
doc/index.rst
Executable file → Normal file
@@ -82,7 +82,7 @@ __ ../../../../index.htm
|
||||
|
||||
.. _`Boost Consulting`: http://www.boost-consulting.com
|
||||
|
||||
.. _concepts: ../../../more/generic_programming.html#concept
|
||||
.. _concepts: http://www.boost.org/more/generic_programming.html#concept
|
||||
|
||||
-------------------------------------
|
||||
|
||||
|
||||
27
doc/python.rst
Executable file → Normal file
27
doc/python.rst
Executable file → Normal file
@@ -132,7 +132,8 @@ Python we use the binding utility ``boost::parameter::python::function``.
|
||||
and pass to ``boost::python::class_::def()``.
|
||||
|
||||
To use ``boost::parameter::python::function`` we first need to define
|
||||
a class with forwarding overloads.
|
||||
a class with forwarding overloads. This is needed because ``window::open()``
|
||||
is a function template, so we can't refer to it in any other way.
|
||||
|
||||
::
|
||||
|
||||
@@ -204,7 +205,9 @@ 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.
|
||||
|
||||
.. The
|
||||
pointer syntax means that the parameter is optional, so in this case
|
||||
@@ -295,8 +298,10 @@ the **arity range** of ``mpl::vector2<x(int),y*(int)>`` is ``[2,2]`` and the
|
||||
|
||||
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. An example_ of this is given in the Boost.Parameter
|
||||
docs. The example uses a different technique, but could also have been written like this:
|
||||
based on the presence of a parameter. For example:
|
||||
|
||||
.. An example_ of this is given in the Boost.Parameter
|
||||
docs. The example uses a different technique, but could also have been written like this:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@@ -351,18 +356,20 @@ docs. The example uses a different technique, but could also have been written l
|
||||
|
||||
.. @build()
|
||||
|
||||
.. _example: index.html#dispatching-based-on-the-presence-of-a-default
|
||||
.. .. _example: index.html#dispatching-based-on-the-presence-of-a-default
|
||||
|
||||
In the above example the type of the default for ``color`` is ``mpl::false_``, a
|
||||
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. 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 2\ :sup:`N`, where ``N`` is the number of *special* keywords.
|
||||
keyword as a *special* keyword. This is done by specifying the tag as
|
||||
``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 2\
|
||||
:sup:`N`, where ``N`` is the number of *special* keywords.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
2
doc/reference.rst
Executable file → Normal file
2
doc/reference.rst
Executable file → Normal file
@@ -174,7 +174,7 @@ Concepts
|
||||
|
||||
This section describes the generic type concepts_ used by the Parameter library.
|
||||
|
||||
.. _concepts: ../../../../more/generic_programming.html#concept
|
||||
.. _concepts: http://www.boost.org/more/generic_programming.html#concept
|
||||
|
||||
|ArgumentPack|
|
||||
--------------
|
||||
|
||||
2
include/boost/parameter.hpp
Executable file → Normal file
2
include/boost/parameter.hpp
Executable file → Normal file
@@ -3,6 +3,8 @@
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See www.boost.org/libs/parameter for documentation.
|
||||
|
||||
#ifndef BOOST_PARAMETER_050401_HPP
|
||||
#define BOOST_PARAMETER_050401_HPP
|
||||
|
||||
|
||||
6
include/boost/parameter/aux_/arg_list.hpp
Executable file → Normal file
6
include/boost/parameter/aux_/arg_list.hpp
Executable file → Normal file
@@ -11,6 +11,7 @@
|
||||
#include <boost/parameter/aux_/default.hpp>
|
||||
#include <boost/parameter/aux_/parameter_requirements.hpp>
|
||||
#include <boost/parameter/aux_/yesno.hpp>
|
||||
#include <boost/parameter/aux_/maybe.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#include <boost/mpl/apply.hpp>
|
||||
@@ -23,6 +24,7 @@
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
@@ -158,10 +160,6 @@ no_tag operator*(empty_arg_list, KW*);
|
||||
template <class KW, class T>
|
||||
struct tagged_argument;
|
||||
|
||||
// Forward declaration for arg_list::operator[], with
|
||||
// IS_XXX helper
|
||||
struct maybe_base;
|
||||
|
||||
template <class T>
|
||||
struct is_maybe
|
||||
: is_base_and_derived<maybe_base, T>
|
||||
|
||||
2
include/boost/parameter/aux_/cast.hpp
Executable file → Normal file
2
include/boost/parameter/aux_/cast.hpp
Executable file → Normal file
@@ -5,6 +5,8 @@
|
||||
#ifndef BOOST_PARAMETER_CAST_060902_HPP
|
||||
# define BOOST_PARAMETER_CAST_060902_HPP
|
||||
|
||||
# include <boost/detail/workaround.hpp>
|
||||
|
||||
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
# include <boost/type_traits/add_reference.hpp>
|
||||
|
||||
14
include/boost/parameter/aux_/default.hpp
Executable file → Normal file
14
include/boost/parameter/aux_/default.hpp
Executable file → Normal file
@@ -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 <boost/detail/workaround.hpp>
|
||||
|
||||
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<KW,DefaultComputer>(x)
|
||||
{}
|
||||
};
|
||||
# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
|
||||
#else
|
||||
# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
|
||||
# else
|
||||
template <class KW, class DefaultComputer>
|
||||
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
|
||||
|
||||
|
||||
0
include/boost/parameter/aux_/maybe.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/maybe.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/overloads.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/overloads.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/parameter_requirements.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/parameter_requirements.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/parenthesized_type.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/parenthesized_type.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/preprocessor/flatten.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/preprocessor/flatten.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/preprocessor/for_each.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/preprocessor/for_each.hpp
Executable file → Normal file
1
include/boost/parameter/aux_/python/invoker.hpp
Executable file → Normal file
1
include/boost/parameter/aux_/python/invoker.hpp
Executable file → Normal file
@@ -8,6 +8,7 @@
|
||||
# include <boost/mpl/begin.hpp>
|
||||
# include <boost/mpl/next.hpp>
|
||||
# include <boost/mpl/deref.hpp>
|
||||
# include <boost/mpl/size.hpp>
|
||||
# include <boost/parameter/keyword.hpp>
|
||||
# include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
|
||||
0
include/boost/parameter/aux_/python/invoker_iterate.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/python/invoker_iterate.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/result_of0.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/result_of0.hpp
Executable file → Normal file
2
include/boost/parameter/aux_/set.hpp
Executable file → Normal file
2
include/boost/parameter/aux_/set.hpp
Executable file → Normal file
@@ -5,6 +5,8 @@
|
||||
#ifndef BOOST_PARAMETER_SET_060912_HPP
|
||||
# define BOOST_PARAMETER_SET_060912_HPP
|
||||
|
||||
# include <boost/detail/workaround.hpp>
|
||||
|
||||
# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
|
||||
&& !BOOST_WORKAROUND(__GNUC__, < 3)
|
||||
# include <boost/mpl/insert.hpp>
|
||||
|
||||
0
include/boost/parameter/aux_/tag.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/tag.hpp
Executable file → Normal file
1
include/boost/parameter/aux_/tagged_argument.hpp
Executable file → Normal file
1
include/boost/parameter/aux_/tagged_argument.hpp
Executable file → Normal file
@@ -14,6 +14,7 @@
|
||||
# include <boost/mpl/and.hpp>
|
||||
# include <boost/mpl/not.hpp>
|
||||
# include <boost/type_traits/is_same.hpp>
|
||||
# include <boost/type_traits/is_convertible.hpp>
|
||||
# include <boost/type_traits/is_reference.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
0
include/boost/parameter/aux_/template_keyword.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/template_keyword.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/unwrap_cv_reference.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/unwrap_cv_reference.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/void.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/void.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/yesno.hpp
Executable file → Normal file
0
include/boost/parameter/aux_/yesno.hpp
Executable file → Normal file
0
include/boost/parameter/binding.hpp
Executable file → Normal file
0
include/boost/parameter/binding.hpp
Executable file → Normal file
0
include/boost/parameter/config.hpp
Executable file → Normal file
0
include/boost/parameter/config.hpp
Executable file → Normal file
40
include/boost/parameter/keyword.hpp
Executable file → Normal file
40
include/boost/parameter/keyword.hpp
Executable file → Normal file
@@ -91,14 +91,18 @@ struct keyword
|
||||
// every instantiation of a function template is the same object.
|
||||
// We provide a reference to a common instance of each keyword
|
||||
// object and prevent construction by users.
|
||||
|
||||
static keyword<Tag> const instance;
|
||||
|
||||
// This interface is deprecated
|
||||
static keyword<Tag>& get()
|
||||
{
|
||||
static keyword<Tag> result;
|
||||
return result;
|
||||
return const_cast<keyword<Tag>&>(instance);
|
||||
}
|
||||
};
|
||||
|
||||
template <class Tag>
|
||||
keyword<Tag> const keyword<Tag>::instance = {};
|
||||
|
||||
// Reduces boilerplate required to declare and initialize keywords
|
||||
// without violating ODR. Declares a keyword tag type with the given
|
||||
// name in namespace tag_namespace, and declares and initializes a
|
||||
@@ -107,19 +111,19 @@ struct keyword
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
|
||||
# define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
|
||||
namespace tag_namespace \
|
||||
{ \
|
||||
struct name \
|
||||
{ \
|
||||
static char const* keyword_name() \
|
||||
{ \
|
||||
return #name; \
|
||||
} \
|
||||
}; \
|
||||
} \
|
||||
static ::boost::parameter::keyword<tag_namespace::name>& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::get();
|
||||
# define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
|
||||
namespace tag_namespace \
|
||||
{ \
|
||||
struct name \
|
||||
{ \
|
||||
static char const* keyword_name() \
|
||||
{ \
|
||||
return #name; \
|
||||
} \
|
||||
}; \
|
||||
} \
|
||||
static ::boost::parameter::keyword<tag_namespace::name> const& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::instance;
|
||||
|
||||
#else
|
||||
|
||||
@@ -136,8 +140,8 @@ struct keyword
|
||||
} \
|
||||
namespace \
|
||||
{ \
|
||||
::boost::parameter::keyword<tag_namespace::name>& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::get(); \
|
||||
::boost::parameter::keyword<tag_namespace::name> const& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::instance;\
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
3
include/boost/parameter/macros.hpp
Executable file → Normal file
3
include/boost/parameter/macros.hpp
Executable file → Normal file
@@ -15,13 +15,14 @@
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_FUN_TEMPLATE_HEAD1(n) \
|
||||
template<BOOST_PP_ENUM_PARAMS(n, class T)>
|
||||
|
||||
#define BOOST_PARAMETER_FUN_TEMPLATE_HEAD0(n)
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
|
||||
# define BOOST_PARAMETER_MATCH_TYPE(n, param) \
|
||||
BOOST_PP_EXPR_IF(n, typename) param::match \
|
||||
|
||||
0
include/boost/parameter/match.hpp
Executable file → Normal file
0
include/boost/parameter/match.hpp
Executable file → Normal file
11
include/boost/parameter/name.hpp
Executable file → Normal file
11
include/boost/parameter/name.hpp
Executable file → Normal file
@@ -16,7 +16,8 @@
|
||||
# include <boost/mpl/placeholders.hpp>
|
||||
|
||||
# if !defined(BOOST_NO_SFINAE) \
|
||||
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
|
||||
# include <boost/utility/enable_if.hpp>
|
||||
# include <boost/mpl/lambda.hpp>
|
||||
@@ -76,14 +77,14 @@ struct lambda<
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
# define BOOST_PARAMETER_NAME_OBJECT(tag, name) \
|
||||
static ::boost::parameter::keyword<tag>& name \
|
||||
= ::boost::parameter::keyword<tag>::get();
|
||||
static ::boost::parameter::keyword<tag> const& name \
|
||||
= ::boost::parameter::keyword<tag>::instance;
|
||||
# else
|
||||
# define BOOST_PARAMETER_NAME_OBJECT(tag, name) \
|
||||
namespace \
|
||||
{ \
|
||||
::boost::parameter::keyword<tag>& name \
|
||||
= ::boost::parameter::keyword<tag>::get(); \
|
||||
::boost::parameter::keyword<tag> const& name \
|
||||
= ::boost::parameter::keyword<tag>::instance; \
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
6
include/boost/parameter/parameters.hpp
Executable file → Normal file
6
include/boost/parameter/parameters.hpp
Executable file → Normal file
@@ -725,7 +725,7 @@ struct parameters
|
||||
// ::type).
|
||||
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
// If NamedList satisfies the PS0, PS1, ..., this is a
|
||||
// metafunction returning parameters. Otherwise it
|
||||
// has no nested ::type.
|
||||
@@ -775,7 +775,7 @@ struct parameters
|
||||
#endif
|
||||
>
|
||||
struct match
|
||||
# ifndef BOOST_NO_SFINAE
|
||||
# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
: match_base<
|
||||
typename aux::make_arg_list<
|
||||
typename BOOST_PARAMETER_build_arg_list(
|
||||
@@ -835,7 +835,7 @@ struct parameters
|
||||
// !!!NOTE!!!
|
||||
//
|
||||
// The make_arg_list<> produces a reversed arg_list, so
|
||||
// we need to pass the arguments to it's constructor
|
||||
// we need to pass the arguments to its constructor
|
||||
// reversed.
|
||||
//
|
||||
aux::empty_arg_list operator()() const
|
||||
|
||||
14
include/boost/parameter/preprocessor.hpp
Executable file → Normal file
14
include/boost/parameter/preprocessor.hpp
Executable file → Normal file
@@ -14,6 +14,7 @@
|
||||
# include <boost/parameter/aux_/preprocessor/flatten.hpp>
|
||||
|
||||
# include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
# include <boost/preprocessor/comparison/equal.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/control/expr_if.hpp>
|
||||
# include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
@@ -23,9 +24,11 @@
|
||||
# include <boost/preprocessor/seq/for_each_product.hpp>
|
||||
# include <boost/preprocessor/seq/for_each_i.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
# include <boost/preprocessor/tuple/eat.hpp>
|
||||
# include <boost/preprocessor/seq/fold_left.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
# include <boost/preprocessor/seq/enum.hpp>
|
||||
# include <boost/preprocessor/seq/push_back.hpp>
|
||||
|
||||
# include <boost/preprocessor/detail/is_nullary.hpp>
|
||||
|
||||
@@ -38,7 +41,7 @@
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
# ifndef BOOST_NO_SFINAE
|
||||
# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
|
||||
// Given Match, which is "void x" where x is an argument matching
|
||||
// criterion, extract a corresponding MPL predicate.
|
||||
@@ -149,7 +152,8 @@ struct argument_pack
|
||||
, typename Parameters::deduced_list
|
||||
, tag_keyword_arg
|
||||
, mpl::false_
|
||||
>::type type;
|
||||
>::type result;
|
||||
typedef typename mpl::first<result>::type type;
|
||||
};
|
||||
|
||||
# if 1 //BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
@@ -353,7 +357,7 @@ struct funptr_predicate<void**>
|
||||
template<BOOST_PP_ENUM_PARAMS_Z(z, n, class ParameterArgumentType)>
|
||||
/**/
|
||||
|
||||
# ifndef BOOST_NO_SFINAE
|
||||
# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
# define BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z(z, name, parameters, n) \
|
||||
, typename boost::parameter::aux::match< \
|
||||
parameters, BOOST_PP_ENUM_PARAMS(n, ParameterArgumentType) \
|
||||
@@ -685,7 +689,7 @@ struct funptr_predicate<void**>
|
||||
# define BOOST_PARAMETER_FUNCTION_DEFAULT_EVAL_DEFAULT(arg, tag_namespace) \
|
||||
boost::parameter::keyword< \
|
||||
tag_namespace::BOOST_PARAMETER_FN_ARG_KEYWORD(arg) \
|
||||
>::get() | boost::parameter::aux::use_default_tag()
|
||||
>::instance | boost::parameter::aux::use_default_tag()
|
||||
|
||||
# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_GET_ARG(arg, tag_ns) \
|
||||
BOOST_PARAMETER_FUNCTION_CAST( \
|
||||
@@ -834,7 +838,7 @@ struct funptr_predicate<void**>
|
||||
# define BOOST_PARAMETER_FUNCTION_DEFAULT_GET_ARG(r, tag_ns, arg) \
|
||||
, BOOST_PARAMETER_FUNCTION_CAST( \
|
||||
args[ \
|
||||
boost::parameter::keyword<tag_ns::BOOST_PARAMETER_FN_ARG_KEYWORD(arg)>::get() \
|
||||
boost::parameter::keyword<tag_ns::BOOST_PARAMETER_FN_ARG_KEYWORD(arg)>::instance \
|
||||
] \
|
||||
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
|
||||
)
|
||||
|
||||
0
include/boost/parameter/python.hpp
Executable file → Normal file
0
include/boost/parameter/python.hpp
Executable file → Normal file
0
include/boost/parameter/value_type.hpp
Executable file → Normal file
0
include/boost/parameter/value_type.hpp
Executable file → Normal file
0
index.html
Executable file → Normal file
0
index.html
Executable file → Normal file
2
test/basics.cpp
Executable file → Normal file
2
test/basics.cpp
Executable file → Normal file
@@ -107,6 +107,6 @@ int main()
|
||||
|
||||
//f(index = 56, name = 55); // won't compile
|
||||
|
||||
return 0;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
7
test/basics.hpp
Executable file → Normal file
7
test/basics.hpp
Executable file → Normal file
@@ -12,6 +12,7 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <cstring>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
namespace test {
|
||||
|
||||
@@ -79,9 +80,9 @@ struct values_t
|
||||
BOOST_MPL_ASSERT((boost::is_same<Value,Value_>));
|
||||
BOOST_MPL_ASSERT((boost::is_same<Name,Name_>));
|
||||
#endif
|
||||
BOOST_ASSERT(equal(n, n_));
|
||||
BOOST_ASSERT(equal(v, v_));
|
||||
BOOST_ASSERT(equal(i, i_));
|
||||
BOOST_TEST(equal(n, n_));
|
||||
BOOST_TEST(equal(v, v_));
|
||||
BOOST_TEST(equal(i, i_));
|
||||
}
|
||||
|
||||
Name const& n;
|
||||
|
||||
0
test/deduced.cpp
Executable file → Normal file
0
test/deduced.cpp
Executable file → Normal file
0
test/deduced.hpp
Executable file → Normal file
0
test/deduced.hpp
Executable file → Normal file
0
test/deduced_dependent_predicate.cpp
Executable file → Normal file
0
test/deduced_dependent_predicate.cpp
Executable file → Normal file
0
test/deduced_unmatched_arg.cpp
Executable file → Normal file
0
test/deduced_unmatched_arg.cpp
Executable file → Normal file
0
test/duplicates.cpp
Executable file → Normal file
0
test/duplicates.cpp
Executable file → Normal file
0
test/earwicker.cpp
Executable file → Normal file
0
test/earwicker.cpp
Executable file → Normal file
0
test/efficiency.cpp
Executable file → Normal file
0
test/efficiency.cpp
Executable file → Normal file
0
test/macros.cpp
Executable file → Normal file
0
test/macros.cpp
Executable file → Normal file
0
test/maybe.cpp
Executable file → Normal file
0
test/maybe.cpp
Executable file → Normal file
0
test/mpl.cpp
Executable file → Normal file
0
test/mpl.cpp
Executable file → Normal file
0
test/normalized_argument_types.cpp
Executable file → Normal file
0
test/normalized_argument_types.cpp
Executable file → Normal file
0
test/ntp.cpp
Executable file → Normal file
0
test/ntp.cpp
Executable file → Normal file
0
test/optional_deduced_sfinae.cpp
Executable file → Normal file
0
test/optional_deduced_sfinae.cpp
Executable file → Normal file
2
test/preprocessor.cpp
Executable file → Normal file
2
test/preprocessor.cpp
Executable file → Normal file
@@ -453,7 +453,7 @@ int main()
|
||||
, name = S("foo")
|
||||
);
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
assert(sfinae("foo") == 1);
|
||||
assert(sfinae(1) == 0);
|
||||
|
||||
|
||||
0
test/preprocessor_deduced.cpp
Executable file → Normal file
0
test/preprocessor_deduced.cpp
Executable file → Normal file
0
test/python_test.cpp
Executable file → Normal file
0
test/python_test.cpp
Executable file → Normal file
6
test/sfinae.cpp
Executable file → Normal file
6
test/sfinae.cpp
Executable file → Normal file
@@ -9,7 +9,7 @@
|
||||
#include <string>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
# include <boost/utility/enable_if.hpp>
|
||||
# include <boost/type_traits/is_same.hpp>
|
||||
#endif
|
||||
@@ -70,7 +70,7 @@ namespace test
|
||||
f_impl(args(a0, a1));
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
// On compilers that actually support SFINAE, add another overload
|
||||
// that is an equally good match and can only be in the overload set
|
||||
// when the others are not. This tests that the SFINAE is actually
|
||||
@@ -96,7 +96,7 @@ int main()
|
||||
f("foo", 3.f);
|
||||
f(value = 3.f, name = "foo");
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
BOOST_TEST(f(3, 4) == 0);
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
|
||||
0
test/singular.cpp
Executable file → Normal file
0
test/singular.cpp
Executable file → Normal file
0
test/timings.txt
Executable file → Normal file
0
test/timings.txt
Executable file → Normal file
0
test/tutorial.cpp
Executable file → Normal file
0
test/tutorial.cpp
Executable file → Normal file
0
test/unwrap_cv_reference.cpp
Executable file → Normal file
0
test/unwrap_cv_reference.cpp
Executable file → Normal file
Reference in New Issue
Block a user