mirror of
https://github.com/boostorg/parameter.git
synced 2026-01-21 05:02:14 +00:00
Compare commits
53 Commits
svn-branch
...
boost-1.34
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe43dad724 | ||
|
|
ce2d43c1b5 | ||
|
|
86d7201a99 | ||
|
|
ccf40a29c1 | ||
|
|
28ed7b9704 | ||
|
|
6c3ee189d1 | ||
|
|
15048a1d82 | ||
|
|
3852ff760c | ||
|
|
916b4d2c2f | ||
|
|
af9b04e7ad | ||
|
|
894dffe6ff | ||
|
|
c17ea8d26d | ||
|
|
1844c27699 | ||
|
|
9694b76bf2 | ||
|
|
7c9ddf23e0 | ||
|
|
224d313a05 | ||
|
|
47c53efbaa | ||
|
|
57ef2b6ee9 | ||
|
|
297e85c0f1 | ||
|
|
3a59d2cea3 | ||
|
|
58bb633dc0 | ||
|
|
3397bafb4a | ||
|
|
cc256f0bb3 | ||
|
|
e3b060b3e5 | ||
|
|
0791667e33 | ||
|
|
91ffd43483 | ||
|
|
fa751e022e | ||
|
|
1f6c9a3034 | ||
|
|
6c209395aa | ||
|
|
5231f04b27 | ||
|
|
c7258e9c9e | ||
|
|
22a1f905e9 | ||
|
|
0417a36693 | ||
|
|
d42b860b8d | ||
|
|
c5168be5d7 | ||
|
|
c29a75c9df | ||
|
|
e18d621508 | ||
|
|
40399d3505 | ||
|
|
d6db8c6216 | ||
|
|
38817a8bb5 | ||
|
|
646c519dc0 | ||
|
|
cb501f9f38 | ||
|
|
7eb7737095 | ||
|
|
bfc5811fdc | ||
|
|
1f8f44b26c | ||
|
|
6729c38504 | ||
|
|
cf5d2c46f5 | ||
|
|
49e928273d | ||
|
|
00bbfbb20c | ||
|
|
ca120a3f04 | ||
|
|
e2b452c1f4 | ||
|
|
6695f76c5f | ||
|
|
bf25a637c8 |
0
doc/Jamfile.v2
Normal file → Executable file
0
doc/Jamfile.v2
Normal file → Executable file
0
doc/html/index.html
Normal file → Executable file
0
doc/html/index.html
Normal file → Executable 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-12-14" />
|
||||
<meta name="date" content="2006-09-21" />
|
||||
<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-12-14</td></tr>
|
||||
<td>2006-09-21</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="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>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id7" id="introduction" name="introduction">Introduction</a></h1>
|
||||
<h1><a class="toc-backref" href="#id8" 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="#id8" id="tutorial" name="tutorial">Tutorial</a></h1>
|
||||
<h1><a class="toc-backref" href="#id9" 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,8 +124,7 @@ 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. 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>
|
||||
a class with forwarding overloads.</p>
|
||||
<pre class="literal-block">
|
||||
struct open_fwd
|
||||
{
|
||||
@@ -189,9 +188,7 @@ 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>,
|
||||
which is passed as the first argument to <tt class="docutils literal"><span class="pre">operator()</span></tt> in the forwarding
|
||||
class.</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>.</p>
|
||||
<!-- The
|
||||
pointer syntax means that the parameter is optional, so in this case
|
||||
``width`` and ``height`` are optional parameters. The third parameter
|
||||
@@ -243,7 +240,7 @@ types instead). -->
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id9" id="concept-parameterspec" name="concept-parameterspec">concept <span class="concept">ParameterSpec</span></a></h1>
|
||||
<h1><a class="toc-backref" href="#id10" 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>
|
||||
@@ -264,12 +261,11 @@ 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="#id10" id="special-keywords" name="special-keywords"><em>special</em> keywords</a></h1>
|
||||
<h1><a class="toc-backref" href="#id11" 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. 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: -->
|
||||
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>
|
||||
<pre class="literal-block">
|
||||
namespace core
|
||||
{
|
||||
@@ -317,21 +313,19 @@ 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. 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>
|
||||
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>
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<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>
|
||||
<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>
|
||||
<p>Defines a named parameter enabled constructor.</p>
|
||||
<pre class="literal-block">
|
||||
template <class ParameterSpecs>
|
||||
@@ -354,7 +348,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 border="1" class="docutils table">
|
||||
<colgroup>
|
||||
<col width="30%" />
|
||||
<col width="17%" />
|
||||
@@ -388,7 +382,7 @@ expressions:</p>
|
||||
uses CallPolicies when creating the binding.</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="example" name="example">Example</a></h2>
|
||||
<h2><a id="id3" name="id3">Example</a></h2>
|
||||
<pre class="literal-block">
|
||||
#include <boost/parameter/keyword.hpp>
|
||||
#include <boost/parameter/preprocessor.hpp>
|
||||
@@ -447,7 +441,7 @@ assert(args[y | 1] == 1);
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -470,7 +464,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 border="1" class="docutils table">
|
||||
<colgroup>
|
||||
<col width="24%" />
|
||||
<col width="26%" />
|
||||
@@ -500,12 +494,12 @@ instance of <tt class="docutils literal"><span class="pre">Class</span></tt>:</p
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<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>
|
||||
<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>
|
||||
<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="id4" name="id4">Example</a></h2>
|
||||
<h2><a id="id5" name="id5">Example</a></h2>
|
||||
<pre class="literal-block">
|
||||
#include <boost/parameter/keyword.hpp>
|
||||
#include <boost/parameter/preprocessor.hpp>
|
||||
@@ -574,7 +568,7 @@ return 0;
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<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>
|
||||
<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>
|
||||
<p>Defines a named parameter enabled member function.</p>
|
||||
<pre class="literal-block">
|
||||
template <class Fwd, class ParameterSpecs>
|
||||
@@ -594,7 +588,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 border="1" class="docutils table">
|
||||
<colgroup>
|
||||
<col width="39%" />
|
||||
<col width="18%" />
|
||||
@@ -626,7 +620,7 @@ are tagged arguments.</p>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="id5" name="id5">Example</a></h2>
|
||||
<h2><a id="id6" name="id6">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>
|
||||
@@ -690,7 +684,7 @@ assert(y == 1);
|
||||
</div>
|
||||
<hr class="docutils" />
|
||||
<div class="section">
|
||||
<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>
|
||||
<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>
|
||||
<p>Defines a named parameter enabled free function in the current Python scope.</p>
|
||||
<pre class="literal-block">
|
||||
template <class Fwd, class ParameterSpecs>
|
||||
@@ -705,7 +699,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 border="1" class="docutils table">
|
||||
<colgroup>
|
||||
<col width="39%" />
|
||||
<col width="21%" />
|
||||
@@ -735,7 +729,7 @@ is the result type of <tt class="docutils literal"><span class="pre">f(…)</spa
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="id6" name="id6">Example</a></h2>
|
||||
<h2><a id="id7" name="id7">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>
|
||||
@@ -772,14 +766,14 @@ BOOST_PYTHON_MODULE(…)
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h1><a class="toc-backref" href="#id15" id="portability" name="portability">Portability</a></h1>
|
||||
<h1><a class="toc-backref" href="#id16" 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 16:40 UTC.
|
||||
Generated on: 2007-01-03 17:02 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
Normal file → Executable file
0
doc/html/reference.html
Normal file → Executable file
0
doc/html/rst.css
Normal file → Executable file
0
doc/html/rst.css
Normal file → Executable file
0
doc/html/vellipsis.gif
Normal file → Executable file
0
doc/html/vellipsis.gif
Normal file → Executable file
|
Before Width: | Height: | Size: 62 B After Width: | Height: | Size: 62 B |
2
doc/index.rst
Normal file → Executable file
2
doc/index.rst
Normal file → Executable file
@@ -82,7 +82,7 @@ __ ../../../../index.htm
|
||||
|
||||
.. _`Boost Consulting`: http://www.boost-consulting.com
|
||||
|
||||
.. _concepts: http://www.boost.org/more/generic_programming.html#concept
|
||||
.. _concepts: ../../../more/generic_programming.html#concept
|
||||
|
||||
-------------------------------------
|
||||
|
||||
|
||||
27
doc/python.rst
Normal file → Executable file
27
doc/python.rst
Normal file → Executable file
@@ -132,8 +132,7 @@ 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. This is needed because ``window::open()``
|
||||
is a function template, so we can't refer to it in any other way.
|
||||
a class with forwarding overloads.
|
||||
|
||||
::
|
||||
|
||||
@@ -205,9 +204,7 @@ 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``,
|
||||
which is passed as the first argument to ``operator()`` in the forwarding
|
||||
class.
|
||||
the `MPL Sequence`_ is the return type of the function, in this case ``void``.
|
||||
|
||||
.. The
|
||||
pointer syntax means that the parameter is optional, so in this case
|
||||
@@ -298,10 +295,8 @@ 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. 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:
|
||||
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:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
@@ -356,20 +351,18 @@ based on the presence of a parameter. For example:
|
||||
|
||||
.. @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. 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.
|
||||
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.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
2
doc/reference.rst
Normal file → Executable file
2
doc/reference.rst
Normal file → Executable file
@@ -174,7 +174,7 @@ Concepts
|
||||
|
||||
This section describes the generic type concepts_ used by the Parameter library.
|
||||
|
||||
.. _concepts: http://www.boost.org/more/generic_programming.html#concept
|
||||
.. _concepts: ../../../../more/generic_programming.html#concept
|
||||
|
||||
|ArgumentPack|
|
||||
--------------
|
||||
|
||||
2
include/boost/parameter.hpp
Normal file → Executable file
2
include/boost/parameter.hpp
Normal file → Executable file
@@ -3,8 +3,6 @@
|
||||
// (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
Normal file → Executable file
6
include/boost/parameter/aux_/arg_list.hpp
Normal file → Executable file
@@ -11,7 +11,6 @@
|
||||
#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>
|
||||
@@ -24,7 +23,6 @@
|
||||
#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 {
|
||||
@@ -160,6 +158,10 @@ 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
Normal file → Executable file
2
include/boost/parameter/aux_/cast.hpp
Normal file → Executable file
@@ -5,8 +5,6 @@
|
||||
#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
Normal file → Executable file
14
include/boost/parameter/aux_/default.hpp
Normal file → Executable file
@@ -4,9 +4,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef DEFAULT_050329_HPP
|
||||
# define DEFAULT_050329_HPP
|
||||
|
||||
# include <boost/detail/workaround.hpp>
|
||||
#define DEFAULT_050329_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
@@ -29,7 +27,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.
|
||||
@@ -50,8 +48,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
|
||||
{
|
||||
@@ -60,8 +58,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
Normal file → Executable file
0
include/boost/parameter/aux_/maybe.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/overloads.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/overloads.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/parameter_requirements.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/parameter_requirements.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/parenthesized_type.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/parenthesized_type.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/preprocessor/flatten.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/preprocessor/flatten.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/preprocessor/for_each.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/preprocessor/for_each.hpp
Normal file → Executable file
1
include/boost/parameter/aux_/python/invoker.hpp
Normal file → Executable file
1
include/boost/parameter/aux_/python/invoker.hpp
Normal file → Executable file
@@ -8,7 +8,6 @@
|
||||
# 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
Normal file → Executable file
0
include/boost/parameter/aux_/python/invoker_iterate.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/result_of0.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/result_of0.hpp
Normal file → Executable file
2
include/boost/parameter/aux_/set.hpp
Normal file → Executable file
2
include/boost/parameter/aux_/set.hpp
Normal file → Executable file
@@ -5,8 +5,6 @@
|
||||
#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
Normal file → Executable file
0
include/boost/parameter/aux_/tag.hpp
Normal file → Executable file
1
include/boost/parameter/aux_/tagged_argument.hpp
Normal file → Executable file
1
include/boost/parameter/aux_/tagged_argument.hpp
Normal file → Executable file
@@ -14,7 +14,6 @@
|
||||
# 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
Normal file → Executable file
0
include/boost/parameter/aux_/template_keyword.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/unwrap_cv_reference.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/unwrap_cv_reference.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/void.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/void.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/yesno.hpp
Normal file → Executable file
0
include/boost/parameter/aux_/yesno.hpp
Normal file → Executable file
0
include/boost/parameter/binding.hpp
Normal file → Executable file
0
include/boost/parameter/binding.hpp
Normal file → Executable file
0
include/boost/parameter/config.hpp
Normal file → Executable file
0
include/boost/parameter/config.hpp
Normal file → Executable file
40
include/boost/parameter/keyword.hpp
Normal file → Executable file
40
include/boost/parameter/keyword.hpp
Normal file → Executable file
@@ -91,18 +91,14 @@ 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()
|
||||
{
|
||||
return const_cast<keyword<Tag>&>(instance);
|
||||
static keyword<Tag> result;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
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
|
||||
@@ -111,19 +107,19 @@ keyword<Tag> const keyword<Tag>::instance = {};
|
||||
|
||||
#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> const& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::instance;
|
||||
# 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();
|
||||
|
||||
#else
|
||||
|
||||
@@ -140,8 +136,8 @@ keyword<Tag> const keyword<Tag>::instance = {};
|
||||
} \
|
||||
namespace \
|
||||
{ \
|
||||
::boost::parameter::keyword<tag_namespace::name> const& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::instance;\
|
||||
::boost::parameter::keyword<tag_namespace::name>& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::get(); \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
3
include/boost/parameter/macros.hpp
Normal file → Executable file
3
include/boost/parameter/macros.hpp
Normal file → Executable file
@@ -15,14 +15,13 @@
|
||||
#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)
|
||||
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
|
||||
# define BOOST_PARAMETER_MATCH_TYPE(n, param) \
|
||||
BOOST_PP_EXPR_IF(n, typename) param::match \
|
||||
|
||||
0
include/boost/parameter/match.hpp
Normal file → Executable file
0
include/boost/parameter/match.hpp
Normal file → Executable file
11
include/boost/parameter/name.hpp
Normal file → Executable file
11
include/boost/parameter/name.hpp
Normal file → Executable file
@@ -16,8 +16,7 @@
|
||||
# include <boost/mpl/placeholders.hpp>
|
||||
|
||||
# if !defined(BOOST_NO_SFINAE) \
|
||||
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
# include <boost/utility/enable_if.hpp>
|
||||
# include <boost/mpl/lambda.hpp>
|
||||
@@ -77,14 +76,14 @@ struct lambda<
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
# define BOOST_PARAMETER_NAME_OBJECT(tag, name) \
|
||||
static ::boost::parameter::keyword<tag> const& name \
|
||||
= ::boost::parameter::keyword<tag>::instance;
|
||||
static ::boost::parameter::keyword<tag>& name \
|
||||
= ::boost::parameter::keyword<tag>::get();
|
||||
# else
|
||||
# define BOOST_PARAMETER_NAME_OBJECT(tag, name) \
|
||||
namespace \
|
||||
{ \
|
||||
::boost::parameter::keyword<tag> const& name \
|
||||
= ::boost::parameter::keyword<tag>::instance; \
|
||||
::boost::parameter::keyword<tag>& name \
|
||||
= ::boost::parameter::keyword<tag>::get(); \
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
6
include/boost/parameter/parameters.hpp
Normal file → Executable file
6
include/boost/parameter/parameters.hpp
Normal file → Executable file
@@ -725,7 +725,7 @@ struct parameters
|
||||
// ::type).
|
||||
|
||||
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
// 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
|
||||
# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
# ifndef BOOST_NO_SFINAE
|
||||
: 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 its constructor
|
||||
// we need to pass the arguments to it's constructor
|
||||
// reversed.
|
||||
//
|
||||
aux::empty_arg_list operator()() const
|
||||
|
||||
14
include/boost/parameter/preprocessor.hpp
Normal file → Executable file
14
include/boost/parameter/preprocessor.hpp
Normal file → Executable file
@@ -14,7 +14,6 @@
|
||||
# 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>
|
||||
@@ -24,11 +23,9 @@
|
||||
# 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>
|
||||
|
||||
@@ -41,7 +38,7 @@
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
# ifndef BOOST_NO_SFINAE
|
||||
|
||||
// Given Match, which is "void x" where x is an argument matching
|
||||
// criterion, extract a corresponding MPL predicate.
|
||||
@@ -152,8 +149,7 @@ struct argument_pack
|
||||
, typename Parameters::deduced_list
|
||||
, tag_keyword_arg
|
||||
, mpl::false_
|
||||
>::type result;
|
||||
typedef typename mpl::first<result>::type type;
|
||||
>::type type;
|
||||
};
|
||||
|
||||
# if 1 //BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
@@ -357,7 +353,7 @@ struct funptr_predicate<void**>
|
||||
template<BOOST_PP_ENUM_PARAMS_Z(z, n, class ParameterArgumentType)>
|
||||
/**/
|
||||
|
||||
# if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
# ifndef BOOST_NO_SFINAE
|
||||
# define BOOST_PARAMETER_FUNCTION_FWD_MATCH_Z(z, name, parameters, n) \
|
||||
, typename boost::parameter::aux::match< \
|
||||
parameters, BOOST_PP_ENUM_PARAMS(n, ParameterArgumentType) \
|
||||
@@ -689,7 +685,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) \
|
||||
>::instance | boost::parameter::aux::use_default_tag()
|
||||
>::get() | boost::parameter::aux::use_default_tag()
|
||||
|
||||
# define BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_GET_ARG(arg, tag_ns) \
|
||||
BOOST_PARAMETER_FUNCTION_CAST( \
|
||||
@@ -838,7 +834,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)>::instance \
|
||||
boost::parameter::keyword<tag_ns::BOOST_PARAMETER_FN_ARG_KEYWORD(arg)>::get() \
|
||||
] \
|
||||
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
|
||||
)
|
||||
|
||||
0
include/boost/parameter/python.hpp
Normal file → Executable file
0
include/boost/parameter/python.hpp
Normal file → Executable file
0
include/boost/parameter/value_type.hpp
Normal file → Executable file
0
include/boost/parameter/value_type.hpp
Normal file → Executable file
0
index.html
Normal file → Executable file
0
index.html
Normal file → Executable file
2
test/basics.cpp
Normal file → Executable file
2
test/basics.cpp
Normal file → Executable file
@@ -107,6 +107,6 @@ int main()
|
||||
|
||||
//f(index = 56, name = 55); // won't compile
|
||||
|
||||
return boost::report_errors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
7
test/basics.hpp
Normal file → Executable file
7
test/basics.hpp
Normal file → Executable file
@@ -12,7 +12,6 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <cstring>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
namespace test {
|
||||
|
||||
@@ -80,9 +79,9 @@ struct values_t
|
||||
BOOST_MPL_ASSERT((boost::is_same<Value,Value_>));
|
||||
BOOST_MPL_ASSERT((boost::is_same<Name,Name_>));
|
||||
#endif
|
||||
BOOST_TEST(equal(n, n_));
|
||||
BOOST_TEST(equal(v, v_));
|
||||
BOOST_TEST(equal(i, i_));
|
||||
BOOST_ASSERT(equal(n, n_));
|
||||
BOOST_ASSERT(equal(v, v_));
|
||||
BOOST_ASSERT(equal(i, i_));
|
||||
}
|
||||
|
||||
Name const& n;
|
||||
|
||||
0
test/deduced.cpp
Normal file → Executable file
0
test/deduced.cpp
Normal file → Executable file
0
test/deduced.hpp
Normal file → Executable file
0
test/deduced.hpp
Normal file → Executable file
0
test/deduced_dependent_predicate.cpp
Normal file → Executable file
0
test/deduced_dependent_predicate.cpp
Normal file → Executable file
0
test/deduced_unmatched_arg.cpp
Normal file → Executable file
0
test/deduced_unmatched_arg.cpp
Normal file → Executable file
0
test/duplicates.cpp
Normal file → Executable file
0
test/duplicates.cpp
Normal file → Executable file
0
test/earwicker.cpp
Normal file → Executable file
0
test/earwicker.cpp
Normal file → Executable file
0
test/efficiency.cpp
Normal file → Executable file
0
test/efficiency.cpp
Normal file → Executable file
0
test/macros.cpp
Normal file → Executable file
0
test/macros.cpp
Normal file → Executable file
0
test/maybe.cpp
Normal file → Executable file
0
test/maybe.cpp
Normal file → Executable file
0
test/mpl.cpp
Normal file → Executable file
0
test/mpl.cpp
Normal file → Executable file
0
test/normalized_argument_types.cpp
Normal file → Executable file
0
test/normalized_argument_types.cpp
Normal file → Executable file
0
test/ntp.cpp
Normal file → Executable file
0
test/ntp.cpp
Normal file → Executable file
0
test/optional_deduced_sfinae.cpp
Normal file → Executable file
0
test/optional_deduced_sfinae.cpp
Normal file → Executable file
2
test/preprocessor.cpp
Normal file → Executable file
2
test/preprocessor.cpp
Normal file → Executable file
@@ -453,7 +453,7 @@ int main()
|
||||
, name = S("foo")
|
||||
);
|
||||
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
assert(sfinae("foo") == 1);
|
||||
assert(sfinae(1) == 0);
|
||||
|
||||
|
||||
0
test/preprocessor_deduced.cpp
Normal file → Executable file
0
test/preprocessor_deduced.cpp
Normal file → Executable file
0
test/python_test.cpp
Normal file → Executable file
0
test/python_test.cpp
Normal file → Executable file
6
test/sfinae.cpp
Normal file → Executable file
6
test/sfinae.cpp
Normal file → Executable file
@@ -9,7 +9,7 @@
|
||||
#include <string>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
# 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));
|
||||
}
|
||||
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
// 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");
|
||||
|
||||
#if ! defined(BOOST_NO_SFINAE) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
BOOST_TEST(f(3, 4) == 0);
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
|
||||
0
test/singular.cpp
Normal file → Executable file
0
test/singular.cpp
Normal file → Executable file
0
test/timings.txt
Normal file → Executable file
0
test/timings.txt
Normal file → Executable file
0
test/tutorial.cpp
Normal file → Executable file
0
test/tutorial.cpp
Normal file → Executable file
0
test/unwrap_cv_reference.cpp
Normal file → Executable file
0
test/unwrap_cv_reference.cpp
Normal file → Executable file
Reference in New Issue
Block a user