Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50863 - in trunk/libs/parameter: doc doc/html test test/literate
From: dave_at_[hidden]
Date: 2009-01-28 18:33:40


Author: dave
Date: 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
New Revision: 50863
URL: http://svn.boost.org/trac/boost/changeset/50863

Log:
bug fix for value_type and numerous doc fixes, along with literate programming tests

Added:
   trunk/libs/parameter/doc/README.txt (contents, props changed)
   trunk/libs/parameter/test/literate/
   trunk/libs/parameter/test/literate/Jamfile.v2 (contents, props changed)
   trunk/libs/parameter/test/literate/README (contents, props changed)
   trunk/libs/parameter/test/literate/building-argumentpacks0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/class-template-skeleton0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/deduced-parameters0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/deduced-template-parameters0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/default-expression-evaluation0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/defining-the-keywords0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/defining-the-keywords1.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/exercising-the-code-so-far0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/extracting-parameter-types0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/extracting-parameter-types1.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/fine-grained-name-control0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/handling-out-parameters0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/headers-and-namespaces0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/lazy-default-computation0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/lazy-default-computation1.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/namespaces0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/namespaces1.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/namespaces2.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/namespaces3.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/optional-parameters0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/parameter-enabled-constructors0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/parameter-enabled-member-functions0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/parameter-enabled-member-functions1.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/predicate-requirements0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/required-parameters0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/template-keywords0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/template-keywords1.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/top-level0.cpp (contents, props changed)
   trunk/libs/parameter/test/literate/writing-the-function0.cpp (contents, props changed)
Properties modified:
   trunk/libs/parameter/doc/html/index.html (contents, props changed)
   trunk/libs/parameter/doc/html/python.html (contents, props changed)
   trunk/libs/parameter/doc/html/reference.html (contents, props changed)
Text files modified:
   trunk/libs/parameter/doc/html/index.html | 121 ++++++++++++++++++++----------------
   trunk/libs/parameter/doc/html/python.html | 21 +++---
   trunk/libs/parameter/doc/html/reference.html | 20 +++---
   trunk/libs/parameter/doc/index.rst | 132 ++++++++++++++++++++++-----------------
   trunk/libs/parameter/doc/python.rst | 10 +-
   trunk/libs/parameter/doc/reference.rst | 8 +-
   trunk/libs/parameter/test/Jamfile.v2 | 2
   7 files changed, 172 insertions(+), 142 deletions(-)

Added: trunk/libs/parameter/doc/README.txt
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/doc/README.txt 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,17 @@
+.. -*-rst-*-
+
+.. Copyright David Abrahams 2009. Distributed under the Boost Software
+.. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or
+.. copy at http://www.boost.org/LICENSE_1_0.txt)
+
+To build the html::
+
+ bjam html
+
+To test the code in this documentation:
+
+.. parsed-literal::
+
+ python ../../../tools/litre/tool.py `pwd`/index.rst --dump_dir=../test/literate
+ cd ../test/literate
+ bjam

Modified: trunk/libs/parameter/doc/html/index.html
==============================================================================
--- trunk/libs/parameter/doc/html/index.html (original)
+++ trunk/libs/parameter/doc/html/index.html 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -78,14 +78,14 @@
 <tbody valign="top">
 <tr class="field"><th class="field-name">Authors:</th><td class="field-body">David Abrahams, Daniel Wallin</td>
 </tr>
-<tr class="field"><th class="field-name">Contact:</th><td class="field-body"><a class="reference external" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a>, <a class="reference external" href="mailto:dalwan01&#64;student.umu.se">dalwan01&#64;student.umu.se</a></td>
+<tr class="field"><th class="field-name">Contact:</th><td class="field-body"><a class="reference external" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a>, <a class="reference external" href="mailto:daniel&#64;boostpro.com">daniel&#64;boostpro.com</a></td>
 </tr>
-<tr class="field"><th class="field-name">Organization:</th><td class="field-body"><a class="reference external" href="http://www.boost-consulting.com">Boost Consulting</a></td>
+<tr class="field"><th class="field-name">organization:</th><td class="field-body"><a class="reference external" href="http://www.boostpro.com">BoostPro Computing</a></td>
 </tr>
-<tr class="field"><th class="field-name">Date:</th><td class="field-body">$Date: 2005/07/18 20:34:31 $</td>
+<tr class="field"><th class="field-name">date:</th><td class="field-body">$Date: 2005/07/17 19:53:01 $</td>
 </tr>
-<tr class="field"><th class="field-name">Copyright:</th><td class="field-body">Copyright David Abrahams, Daniel Wallin 2005.
-Distributed under the Boost Software License,
+<tr class="field"><th class="field-name">copyright:</th><td class="field-body">Copyright David Abrahams, Daniel Wallin
+2005-2009. Distributed under the Boost Software License,
 Version 1.0. (See accompanying file LICENSE_1_0.txt
 or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt>)</td>
 </tr>
@@ -1026,7 +1026,7 @@
 struct callable2
 {
     BOOST_PARAMETER_CONST_MEMBER_FUNCTION(
- (void), operator(), tag, (required (arg1,(int))(arg2,(int))))
+ (void), call, tag, (required (arg1,(int))(arg2,(int))))
     {
         std::cout &lt;&lt; arg1 &lt;&lt; &quot;, &quot; &lt;&lt; arg2 &lt;&lt; std::endl;
     }
@@ -1034,7 +1034,9 @@
 </pre>
 <!-- @example.prepend('''
 #include <boost/parameter.hpp>
-#include <iostream>''') -->
+#include <iostream>
+using namespace boost::parameter;
+''') -->
 <!-- @test('compile') -->
 <p>These macros don't directly allow a function's interface to be
 separated from its implementation, but you can always forward
@@ -1043,7 +1045,7 @@
 struct callable2
 {
     BOOST_PARAMETER_CONST_MEMBER_FUNCTION(
- (void), operator(), tag, (required (arg1,(int))(arg2,(int))))
+ (void), call, tag, (required (arg1,(int))(arg2,(int))))
     {
         call_impl(arg1,arg2);
     }
@@ -1055,9 +1057,34 @@
 #include <boost/parameter.hpp>
 
 BOOST_PARAMETER_NAME(arg1)
-BOOST_PARAMETER_NAME(arg2)''') -->
+BOOST_PARAMETER_NAME(arg2)
+using namespace boost::parameter;
+''') -->
+<!-- @test('compile') -->
+<div class="section" id="static-member-functions">
+<h3>2.2.1&nbsp;&nbsp;&nbsp;Static Member Functions</h3>
+<p>To expose a static member function, simply insert the keyword
+“<tt class="docutils literal"><span class="pre">static</span></tt>” before the function name:</p>
+<pre class="literal-block">
+BOOST_PARAMETER_NAME(arg1)
+
+struct somebody
+{
+ BOOST_PARAMETER_MEMBER_FUNCTION(
+ (void), <strong>static</strong> f, tag, (optional (arg1,(int))))
+ {
+ std::cout &lt;&lt; arg1 &lt;&lt; std::endl;
+ }
+};
+</pre>
+<!-- @example.prepend('''
+#include <boost/parameter.hpp>
+#include <iostream>
+using namespace boost::parameter;
+''') -->
 <!-- @test('compile') -->
 </div>
+</div>
 <div class="section" id="parameter-enabled-constructors">
 <h2><a class="toc-backref" href="#id29">2.3&nbsp;&nbsp;&nbsp;Parameter-Enabled Constructors</a></h2>
 <p>The lack of a “delegating constructor”
@@ -1224,10 +1251,10 @@
 using boost::mpl::_;
 
 typedef parameter::parameters&lt;
- required&lt;tag::class_type, is_class&lt;_&gt; &gt;
- , optional&lt;tag::base_list, mpl::is_sequence&lt;_&gt; &gt;
- , optional&lt;tag::held_type&gt;
- , optional&lt;tag::copyable&gt;
+ required&lt;tag::class_type, boost::is_class&lt;_&gt; &gt;
+ , parameter::optional&lt;tag::base_list, mpl::is_sequence&lt;_&gt; &gt;
+ , parameter::optional&lt;tag::held_type&gt;
+ , parameter::optional&lt;tag::copyable&gt;
 &gt; class_signature;
 
 }}
@@ -1236,6 +1263,7 @@
 #include <boost/parameter.hpp>
 #include <boost/mpl/is_sequence.hpp>
 #include <boost/noncopyable.hpp>
+#include <boost/type_traits/is_class.hpp>
 #include <memory>
 
 using namespace boost::parameter;
@@ -1255,11 +1283,13 @@
 </div>
 <div class="section" id="argument-packs-and-parameter-extraction">
 <span id="binding-intro"></span><h4>2.4.1.4&nbsp;&nbsp;&nbsp;Argument Packs and Parameter Extraction</h4>
-<p>Next, within the body of <tt class="docutils literal"><span class="pre">class_</span></tt> , we use the <span class="concept">ParameterSpec</span>'s nested <tt class="docutils literal"><span class="pre">::bind&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt> template to bundle the actual arguments
-into an <a class="reference external" href="reference.html#argumentpack"><span class="concept">ArgumentPack</span></a> type, and then use the library's <tt class="docutils literal"><span class="pre">binding&lt;</span>
-<span class="pre">…</span> <span class="pre">&gt;</span></tt> metafunction to extract “logical parameters”. Note that
-defaults are specified by supplying an optional third argument to
-<tt class="docutils literal"><span class="pre">binding&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt>:</p>
+<p>Next, within the body of <tt class="docutils literal"><span class="pre">class_</span></tt> , we use the <span class="concept">ParameterSpec</span>'s
+nested <tt class="docutils literal"><span class="pre">::bind&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt> template to bundle the actual arguments into an
+<a class="reference external" href="reference.html#argumentpack"><span class="concept">ArgumentPack</span></a> type, and then use the library's <tt class="docutils literal"><span class="pre">value_type&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt>
+metafunction to extract “logical parameters”. <tt class="docutils literal"><span class="pre">value_type&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt> is
+a lot like <tt class="docutils literal"><span class="pre">binding&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt>, but no reference is added to the actual
+argument type. Note that defaults are specified by passing it an
+optional third argument:</p>
 <pre class="literal-block">
 namespace boost { namespace python {
 
@@ -1277,16 +1307,16 @@
     args;
 
     // Extract first logical parameter.
- typedef typename parameter::binding&lt;
+ typedef typename parameter::value_type&lt;
       args, tag::class_type&gt;::type class_type;
 
- typedef typename parameter::binding&lt;
+ typedef typename parameter::value_type&lt;
       args, tag::base_list, bases&lt;&gt; &gt;::type base_list;
 
- typedef typename parameter::binding&lt;
+ typedef typename parameter::value_type&lt;
       args, tag::held_type, class_type&gt;::type held_type;
 
- typedef typename parameter::binding&lt;
+ typedef typename parameter::value_type&lt;
       args, tag::copyable, void&gt;::type copyable;
 };
 
@@ -1381,12 +1411,12 @@
 typedef parameter::parameters&lt;
     required&lt;tag::class_type, is_class&lt;_&gt; &gt;
 
- , optional&lt;
+ , parameter::optional&lt;
         deduced&lt;tag::base_list&gt;
       , is_base_and_derived&lt;detail::bases_base,_&gt;
     &gt;
 
- , optional&lt;
+ , parameter::optional&lt;
         deduced&lt;tag::held_type&gt;
       , mpl::not_&lt;
             mpl::or_&lt;
@@ -1396,11 +1426,12 @@
         &gt;
     &gt;
 
- , optional&lt;deduced&lt;tag::copyable&gt;, is_same&lt;noncopyable,_&gt; &gt;
+ , parameter::optional&lt;deduced&lt;tag::copyable&gt;, is_same&lt;noncopyable,_&gt; &gt;
 
 &gt; class_signature;
 </pre>
 <!-- @example.prepend('''
+#include <boost/type_traits/is_class.hpp>
 namespace boost { namespace python {''') -->
 <!-- @example.append('''
 template <
@@ -1417,16 +1448,16 @@
     args;
 
     // Extract first logical parameter.
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
       args, tag::class_type>::type class_type;
 
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
       args, tag::base_list, bases<> >::type base_list;
 
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
       args, tag::held_type, class_type>::type held_type;
 
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
       args, tag::copyable, void>::type copyable;
 };
 
@@ -1613,15 +1644,13 @@
 <p>Occasionally one needs to deduce argument types without an extra
 layer of function call. For example, suppose we wanted to return
 twice the value of the <tt class="docutils literal"><span class="pre">index</span></tt> parameter? In that
-case we can use the <tt class="docutils literal"><span class="pre">binding&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt> metafunction introduced
+case we can use the <tt class="docutils literal"><span class="pre">value_type&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt> metafunction introduced
 <a class="reference internal" href="#binding-intro">earlier</a>:</p>
 <pre class="literal-block">
 BOOST_PARAMETER_NAME(index)
 
 template &lt;class ArgumentPack&gt;
-typename remove_reference&lt;
- typename parameter::binding&lt;ArgumentPack, tag::index, int&gt;::type
-&gt;::type
+typename parameter::value_type&lt;ArgumentPack, tag::index, int&gt;::type
 twice_index(ArgumentPack const&amp; args)
 {
     return 2 * args[_index|42];
@@ -1635,32 +1664,16 @@
 #include <cassert>
 
 namespace parameter = boost::parameter;
-using boost::remove_reference;''') -->
-<p>Note that the <tt class="docutils literal"><span class="pre">remove_reference&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt> dance is necessary because
-<tt class="docutils literal"><span class="pre">binding&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt> will return a reference type when the argument
-is bound in the argument pack. If we don't strip the reference we
-end up returning a reference to the temporary created in the <tt class="docutils literal"><span class="pre">2</span> <span class="pre">*</span> <span class="pre">…</span></tt>
-expression. A convenient shortcut would be to use the <tt class="docutils literal"><span class="pre">value_type&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt>
-metafunction:</p>
-<pre class="literal-block">
-template &lt;class ArgumentPack&gt;
-typename <strong>parameter::value_type&lt;ArgumentPack, tag::index, int&gt;</strong>::type
-twice_index(ArgumentPack const&amp; args)
-{
- return 2 * args[_index|42];
-}
-</pre>
-<!-- @example.wrap('namespace with_value_type {', '''
-int six = twice_index(_index = 3);
-}''') -->
-<!-- TODO: binding<> returns a reference. We should use value_type<> here. -->
+''') -->
 <!-- @example.append('''
 int main()
 {
     assert(six == 6);
- assert(with_value_type::six == 6);
 }''') -->
 <!-- @test('run', howmany='all') -->
+<p>Note that if we had used <tt class="docutils literal"><span class="pre">binding&lt;</span> <span class="pre">…</span> <span class="pre">&gt;</span></tt> rather than <tt class="docutils literal"><span class="pre">value_type&lt;</span> <span class="pre">…</span>
+<span class="pre">&gt;</span></tt>, we would end up returning a reference to the temporary created in
+the <tt class="docutils literal"><span class="pre">2</span> <span class="pre">*</span> <span class="pre">…</span></tt> expression.</p>
 </div>
 <div class="section" id="lazy-default-computation">
 <h3>3.2.3&nbsp;&nbsp;&nbsp;Lazy Default Computation</h3>
@@ -2150,7 +2163,7 @@
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2008-06-26 21:58 UTC.
+Generated on: 2009-01-28 21:49 UTC.
 Generated by <a class="reference external" href="
http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/libs/parameter/doc/html/python.html
==============================================================================
--- trunk/libs/parameter/doc/html/python.html (original)
+++ trunk/libs/parameter/doc/html/python.html 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -5,10 +5,10 @@
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
 <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="2008-03-22" />
-<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)" />
+<meta name="authors" content="David Abrahams Daniel Wallin" />
+<meta name="organization" content="BoostPro Computing" />
+<meta name="date" content="2005-07-17" />
+<meta name="copyright" content="Copyright David Abrahams, Daniel Wallin 2005-2009. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)" />
 <link rel="stylesheet" href="rst.css" type="text/css" />
 </head>
 <body>
@@ -19,16 +19,17 @@
 <col class="docinfo-content" />
 <tbody valign="top">
 <tr><th class="docinfo-name">Authors:</th>
-<td>Daniel Wallin</td></tr>
+<td>David Abrahams
+<br />Daniel Wallin</td></tr>
 <tr><th class="docinfo-name">Contact:</th>
-<td><a class="first last reference external" href="mailto:dalwan01&#64;student.umu.se">dalwan01&#64;student.umu.se</a></td></tr>
+<td><a class="first reference external" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a>, <a class="last reference external" href="mailto:daniel&#64;boostpro.com">daniel&#64;boostpro.com</a></td></tr>
 <tr><th class="docinfo-name">Organization:</th>
-<td><a class="first last reference external" href="http://www.boost-consulting.com">Boost Consulting</a></td></tr>
+<td><a class="first last reference external" href="http://www.boostpro.com">BoostPro Computing</a></td></tr>
 <tr><th class="docinfo-name">Date:</th>
-<td>2008-03-22</td></tr>
+<td>2005-07-17</td></tr>
 <tr><th class="docinfo-name">Copyright:</th>
 <td>Copyright David Abrahams, Daniel Wallin
-2005. Distributed under the Boost Software License,
+2005-2009. Distributed under the Boost Software License,
 Version 1.0. (See accompanying file LICENSE_1_0.txt
 or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt>)</td></tr>
 </tbody>
@@ -779,7 +780,7 @@
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2008-06-26 21:51 UTC.
+Generated on: 2009-01-28 21:49 UTC.
 Generated by <a class="reference external" href="
http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/libs/parameter/doc/html/reference.html
==============================================================================
--- trunk/libs/parameter/doc/html/reference.html (original)
+++ trunk/libs/parameter/doc/html/reference.html 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -6,9 +6,9 @@
 <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
 <title>The Boost Parameter Library Reference Documentation</title>
 <meta name="authors" content="David Abrahams Daniel Wallin" />
-<meta name="organization" content="Boost Consulting" />
+<meta name="organization" content="BoostPro Computing" />
 <meta name="date" content="2005-07-17" />
-<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)" />
+<meta name="copyright" content="Copyright David Abrahams, Daniel Wallin 2005-2009. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)" />
 <link rel="stylesheet" href="rst.css" type="text/css" />
 </head>
 <body>
@@ -22,14 +22,14 @@
 <td>David Abrahams
 <br />Daniel Wallin</td></tr>
 <tr><th class="docinfo-name">Contact:</th>
-<td><a class="first reference external" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a>, <a class="last reference external" href="mailto:dalwan01&#64;student.umu.se">dalwan01&#64;student.umu.se</a></td></tr>
+<td><a class="first reference external" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a>, <a class="last reference external" href="mailto:daniel&#64;boostpro.com">daniel&#64;boostpro.com</a></td></tr>
 <tr><th class="docinfo-name">Organization:</th>
-<td><a class="first last reference external" href="http://www.boost-consulting.com">Boost Consulting</a></td></tr>
+<td><a class="first last reference external" href="http://www.boostpro.com">BoostPro Computing</a></td></tr>
 <tr><th class="docinfo-name">Date:</th>
 <td>2005-07-17</td></tr>
 <tr><th class="docinfo-name">Copyright:</th>
 <td>Copyright David Abrahams, Daniel Wallin
-2005. Distributed under the Boost Software License,
+2005-2009. Distributed under the Boost Software License,
 Version 1.0. (See accompanying file LICENSE_1_0.txt
 or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt>)</td></tr>
 </tbody>
@@ -907,8 +907,8 @@
           return ##<em>tag-name</em>;
       }
 
- typedef <em>implementation defined</em> _;
- typedef <em>implementation defined</em> _1;
+ typedef <em>unspecified</em> _;
+ typedef <em>unspecified</em> _1;
   };
 }
 
@@ -926,8 +926,8 @@
           return ##<em>name</em>;
       }
 
- typedef <em>implementation defined</em> _;
- typedef <em>implementation defined</em> _1;
+ typedef <em>unspecified</em> _;
+ typedef <em>unspecified</em> _1;
   };
 }
 
@@ -1128,7 +1128,7 @@
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2008-06-26 21:51 UTC.
+Generated on: 2009-01-28 21:47 UTC.
 Generated by <a class="reference external" href="
http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/libs/parameter/doc/index.rst
==============================================================================
--- trunk/libs/parameter/doc/index.rst (original)
+++ trunk/libs/parameter/doc/index.rst 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -71,16 +71,16 @@
 -------------------------------------
 
 :Authors: David Abrahams, Daniel Wallin
-:Contact: dave_at_[hidden], dalwan01_at_[hidden]
-:Organization: `Boost Consulting`_
-:Date: $Date: 2005/07/18 20:34:31 $
+:Contact: dave_at_[hidden], daniel_at_[hidden]
+:organization: `BoostPro Computing`_
+:date: $Date: 2005/07/17 19:53:01 $
 
-:Copyright: Copyright David Abrahams, Daniel Wallin 2005.
- Distributed under the Boost Software License,
+:copyright: Copyright David Abrahams, Daniel Wallin
+ 2005-2009. Distributed under the Boost Software License,
                 Version 1.0. (See accompanying file LICENSE_1_0.txt
                 or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-.. _`Boost Consulting`: http://www.boost-consulting.com
+.. _`BoostPro Computing`: http://www.boostpro.com
 
 .. _concepts: http://www.boost.org/more/generic_programming.html#concept
 
@@ -1112,7 +1112,7 @@
   struct callable2
   {
       BOOST_PARAMETER_CONST_MEMBER_FUNCTION(
- (void), operator(), tag, (required (arg1,(int))(arg2,(int))))
+ (void), call, tag, (required (arg1,(int))(arg2,(int))))
       {
           std::cout << arg1 << ", " << arg2 << std::endl;
       }
@@ -1120,7 +1120,9 @@
 
 .. @example.prepend('''
    #include <boost/parameter.hpp>
- #include <iostream>''')
+ #include <iostream>
+ using namespace boost::parameter;
+ ''')
 
 .. @test('compile')
 
@@ -1131,7 +1133,7 @@
   struct callable2
   {
       BOOST_PARAMETER_CONST_MEMBER_FUNCTION(
- (void), operator(), tag, (required (arg1,(int))(arg2,(int))))
+ (void), call, tag, (required (arg1,(int))(arg2,(int))))
       {
           call_impl(arg1,arg2);
       }
@@ -1143,10 +1145,40 @@
    #include <boost/parameter.hpp>
 
    BOOST_PARAMETER_NAME(arg1)
- BOOST_PARAMETER_NAME(arg2)''')
+ BOOST_PARAMETER_NAME(arg2)
+ using namespace boost::parameter;
+ ''')
+
+.. @test('compile')
+
+Static Member Functions
+=======================
+
+To expose a static member function, simply insert the keyword
+“``static``” before the function name:
+
+.. parsed-literal::
+
+ BOOST_PARAMETER_NAME(arg1)
+
+ struct somebody
+ {
+ BOOST_PARAMETER_MEMBER_FUNCTION(
+ (void), **static** f, tag, (optional (arg1,(int))))
+ {
+ std::cout << arg1 << std::endl;
+ }
+ };
+
+.. @example.prepend('''
+ #include <boost/parameter.hpp>
+ #include <iostream>
+ using namespace boost::parameter;
+ ''')
 
 .. @test('compile')
 
+
 ------------------------------
 Parameter-Enabled Constructors
 ------------------------------
@@ -1339,10 +1371,10 @@
   using boost::mpl::_;
 
   typedef parameter::parameters<
- required<tag::class_type, is_class<_> >
- , optional<tag::base_list, mpl::is_sequence<_> >
- , optional<tag::held_type>
- , optional<tag::copyable>
+ required<tag::class_type, boost::is_class<_> >
+ , parameter::optional<tag::base_list, mpl::is_sequence<_> >
+ , parameter::optional<tag::held_type>
+ , parameter::optional<tag::copyable>
> class_signature;
 
   }}
@@ -1351,6 +1383,7 @@
    #include <boost/parameter.hpp>
    #include <boost/mpl/is_sequence.hpp>
    #include <boost/noncopyable.hpp>
+ #include <boost/type_traits/is_class.hpp>
    #include <memory>
 
    using namespace boost::parameter;
@@ -1377,12 +1410,13 @@
 Argument Packs and Parameter Extraction
 ---------------------------------------
 
-Next, within the body of ``class_`` , we use the |ParameterSpec|\
-'s nested ``::bind< … >`` template to bundle the actual arguments
-into an |ArgumentPack|_ type, and then use the library's ``binding<
-… >`` metafunction to extract “logical parameters”. Note that
-defaults are specified by supplying an optional third argument to
-``binding< … >``::
+Next, within the body of ``class_`` , we use the |ParameterSpec|\ 's
+nested ``::bind< … >`` template to bundle the actual arguments into an
+|ArgumentPack|_ type, and then use the library's ``value_type< … >``
+metafunction to extract “logical parameters”. ``value_type< … >`` is
+a lot like ``binding< … >``, but no reference is added to the actual
+argument type. Note that defaults are specified by passing it an
+optional third argument::
 
   namespace boost { namespace python {
 
@@ -1400,16 +1434,16 @@
       args;
 
       // Extract first logical parameter.
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
         args, tag::class_type>::type class_type;
       
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
         args, tag::base_list, bases<> >::type base_list;
       
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
         args, tag::held_type, class_type>::type held_type;
       
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
         args, tag::copyable, void>::type copyable;
   };
 
@@ -1511,12 +1545,12 @@
   typedef parameter::parameters<
       required<tag::class_type, is_class<_> >
 
- , optional<
+ , parameter::optional<
           deduced<tag::base_list>
         , is_base_and_derived<detail::bases_base,_>
>
 
- , optional<
+ , parameter::optional<
           deduced<tag::held_type>
         , mpl::not_<
               mpl::or_<
@@ -1526,11 +1560,12 @@
>
>
 
- , optional<deduced<tag::copyable>, is_same<noncopyable,_> >
+ , parameter::optional<deduced<tag::copyable>, is_same<noncopyable,_> >
 
> class_signature;
 
 .. @example.prepend('''
+ #include <boost/type_traits/is_class.hpp>
    namespace boost { namespace python {''')
 
 .. @example.append('''
@@ -1548,16 +1583,16 @@
        args;
  
        // Extract first logical parameter.
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
          args, tag::class_type>::type class_type;
       
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
          args, tag::base_list, bases<> >::type base_list;
       
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
          args, tag::held_type, class_type>::type held_type;
       
- typedef typename parameter::binding<
+ typedef typename parameter::value_type<
          args, tag::copyable, void>::type copyable;
    };
 
@@ -1778,15 +1813,13 @@
 Occasionally one needs to deduce argument types without an extra
 layer of function call. For example, suppose we wanted to return
 twice the value of the ``index`` parameter? In that
-case we can use the ``binding< … >`` metafunction introduced
+case we can use the ``value_type< … >`` metafunction introduced
 `earlier`__::
 
    BOOST_PARAMETER_NAME(index)
 
    template <class ArgumentPack>
- typename remove_reference<
- typename parameter::binding<ArgumentPack, tag::index, int>::type
- >::type
+ typename parameter::value_type<ArgumentPack, tag::index, int>::type
    twice_index(ArgumentPack const& args)
    {
        return 2 * args[_index|42];
@@ -1800,39 +1833,20 @@
    #include <cassert>
 
    namespace parameter = boost::parameter;
- using boost::remove_reference;''')
-
-Note that the ``remove_reference< … >`` dance is necessary because
-``binding< … >`` will return a reference type when the argument
-is bound in the argument pack. If we don't strip the reference we
-end up returning a reference to the temporary created in the ``2 * …``
-expression. A convenient shortcut would be to use the ``value_type< … >``
-metafunction:
-
-.. parsed-literal::
-
- template <class ArgumentPack>
- typename **parameter::value_type<ArgumentPack, tag::index, int>**::type
- twice_index(ArgumentPack const& args)
- {
- return 2 * args[_index|42];
- }
-
-.. @example.wrap('namespace with_value_type {', '''
- int six = twice_index(_index = 3);
- }''')
-
-.. TODO: binding<> returns a reference. We should use value_type<> here.
+ ''')
 
 .. @example.append('''
    int main()
    {
        assert(six == 6);
- assert(with_value_type::six == 6);
    }''')
 
 .. @test('run', howmany='all')
 
+Note that if we had used ``binding< … >`` rather than ``value_type< …
+>``, we would end up returning a reference to the temporary created in
+the ``2 * …`` expression.
+
 __ binding_intro_
 
 Lazy Default Computation

Modified: trunk/libs/parameter/doc/python.rst
==============================================================================
--- trunk/libs/parameter/doc/python.rst (original)
+++ trunk/libs/parameter/doc/python.rst 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -2,13 +2,13 @@
  The Boost Parameter Library Python Binding Documentation
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-:Authors: Daniel Wallin
-:Contact: dalwan01_at_[hidden]
-:organization: `Boost Consulting`_
+:Authors: David Abrahams, Daniel Wallin
+:Contact: dave_at_[hidden], daniel_at_[hidden]
+:organization: `BoostPro Computing`_
 :date: $Date$
 
 :copyright: Copyright David Abrahams, Daniel Wallin
- 2005. Distributed under the Boost Software License,
+ 2005-2009. Distributed under the Boost Software License,
                 Version 1.0. (See accompanying file LICENSE_1_0.txt
                 or copy at http://www.boost.org/LICENSE_1_0.txt)
 
@@ -22,7 +22,7 @@
 
 __ ../../../../index.htm
 
-.. _`Boost Consulting`: http://www.boost-consulting.com
+.. _`BoostPro Computing`: http://www.boostpro.com
 
 
 .. role:: class

Modified: trunk/libs/parameter/doc/reference.rst
==============================================================================
--- trunk/libs/parameter/doc/reference.rst (original)
+++ trunk/libs/parameter/doc/reference.rst 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -3,12 +3,12 @@
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 :Authors: David Abrahams, Daniel Wallin
-:Contact: dave_at_[hidden], dalwan01_at_[hidden]
-:organization: `Boost Consulting`_
+:Contact: dave_at_[hidden], daniel_at_[hidden]
+:organization: `BoostPro Computing`_
 :date: $Date: 2005/07/17 19:53:01 $
 
 :copyright: Copyright David Abrahams, Daniel Wallin
- 2005. Distributed under the Boost Software License,
+ 2005-2009. Distributed under the Boost Software License,
                 Version 1.0. (See accompanying file LICENSE_1_0.txt
                 or copy at http://www.boost.org/LICENSE_1_0.txt)
 
@@ -19,7 +19,7 @@
 
 __ ../../../../index.htm
 
-.. _`Boost Consulting`: http://www.boost-consulting.com
+.. _`BoostPro Computing`: http://www.boostpro.com
 
 
 //////////////////////////////////////////////////////////////////////////////

Modified: trunk/libs/parameter/test/Jamfile.v2
==============================================================================
--- trunk/libs/parameter/test/Jamfile.v2 (original)
+++ trunk/libs/parameter/test/Jamfile.v2 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -9,6 +9,8 @@
 project boost/parameter
   : default-build <warnings>off
   ;
+
+build-project literate ;
   
 test-suite "parameter"
   : [ run basics.cpp ]

Added: trunk/libs/parameter/test/literate/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/Jamfile.v2 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,33 @@
+
+import testing ;
+
+run extracting-parameter-types0.cpp ;
+run extracting-parameter-types1.cpp ;
+compile template-keywords0.cpp ;
+compile template-keywords1.cpp ;
+compile top-level0.cpp ;
+compile headers-and-namespaces0.cpp ;
+compile predicate-requirements0.cpp ;
+compile handling-out-parameters0.cpp ;
+compile writing-the-function0.cpp ;
+run building-argumentpacks0.cpp ;
+compile defining-the-keywords0.cpp ;
+compile defining-the-keywords1.cpp ;
+compile exercising-the-code-so-far0.cpp ;
+run lazy-default-computation0.cpp ;
+run lazy-default-computation1.cpp ;
+run namespaces0.cpp ;
+run namespaces1.cpp ;
+run namespaces2.cpp ;
+run namespaces3.cpp ;
+compile optional-parameters0.cpp ;
+compile static-member-functions0.cpp ;
+run parameter-enabled-constructors0.cpp ;
+compile required-parameters0.cpp ;
+compile class-template-skeleton0.cpp ;
+compile deduced-template-parameters0.cpp ;
+compile deduced-parameters0.cpp ;
+compile default-expression-evaluation0.cpp ;
+compile parameter-enabled-member-functions0.cpp ;
+compile parameter-enabled-member-functions1.cpp ;
+run fine-grained-name-control0.cpp ;

Added: trunk/libs/parameter/test/literate/README
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/README 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,6 @@
+These tests were extracted from the Boost.Parameter documentation
+with:
+
+python ../../../../tools/litre/tool.py \
+ ../../../../libs/parameter/doc/index.rst \
+ --dump_dir=.

Added: trunk/libs/parameter/test/literate/building-argumentpacks0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/building-argumentpacks0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,53 @@
+
+#line 1711 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <iostream>
+#line 1700 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_NAME(index)
+
+template <class ArgumentPack>
+int print_index(ArgumentPack const& args)
+{
+ std::cout << "index = " << args[_index] << std::endl;
+ return 0;
+}
+
+int x = print_index(_index = 3); // prints "index = 3"
+
+#line 1719 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_NAME(name)
+
+template <class ArgumentPack>
+int print_name_and_index(ArgumentPack const& args)
+{
+ std::cout << "name = " << args[_name] << "; ";
+ return print_index(args);
+}
+
+int y = print_name_and_index((_index = 3, _name = "jones"));
+
+
+#line 1754 "../../../../libs/parameter/doc/index.rst"
+namespace parameter = boost::parameter;
+using parameter::required;
+using parameter::optional;
+using boost::is_convertible;
+using boost::mpl::_;
+#line 1740 "../../../../libs/parameter/doc/index.rst"
+parameter::parameters<
+ required<tag::name, is_convertible<_,char const*> >
+ , optional<tag::index, is_convertible<_,int> >
+> spec;
+
+char const sam[] = "sam";
+int twelve = 12;
+
+int z0 = print_name_and_index( spec(sam, twelve) );
+
+int z1 = print_name_and_index(
+ spec(_index=12, _name="sam")
+);
+#line 1761 "../../../../libs/parameter/doc/index.rst"
+int main()
+{}
+

Added: trunk/libs/parameter/test/literate/class-template-skeleton0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/class-template-skeleton0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,18 @@
+
+#line 1354 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#line 1340 "../../../../libs/parameter/doc/index.rst"
+namespace boost { namespace python {
+
+template <
+ class A0
+ , class A1 = parameter::void_
+ , class A2 = parameter::void_
+ , class A3 = parameter::void_
+>
+struct class_
+{
+
+};
+
+}}

Added: trunk/libs/parameter/test/literate/deduced-parameters0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/deduced-parameters0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,80 @@
+
+#line 1029 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+
+BOOST_PARAMETER_NAME(name)
+BOOST_PARAMETER_NAME(func)
+BOOST_PARAMETER_NAME(docstring)
+BOOST_PARAMETER_NAME(keywords)
+BOOST_PARAMETER_NAME(policies)
+
+struct default_call_policies
+{};
+
+struct no_keywords
+{};
+
+struct keywords
+{};
+
+template <class T>
+struct is_keyword_expression
+ : boost::mpl::false_
+{};
+
+template <>
+struct is_keyword_expression<keywords>
+ : boost::mpl::true_
+{};
+
+default_call_policies some_policies;
+
+void f()
+{}
+#line 996 "../../../../libs/parameter/doc/index.rst"
+namespace mpl = boost::mpl;
+
+BOOST_PARAMETER_FUNCTION(
+ (void), def, tag,
+
+ (required (name,(char const*)) (func,*) ) // nondeduced
+
+ (deduced
+ (optional
+ (docstring, (char const*), "")
+
+ (keywords
+ , *(is_keyword_expression<mpl::_>) // see 5
+ , no_keywords())
+
+ (policies
+ , *(mpl::not_<
+ mpl::or_<
+ boost::is_convertible<mpl::_, char const*>
+ , is_keyword_expression<mpl::_> // see 5
+ >
+ >)
+ , default_call_policies()
+ )
+ )
+ )
+ )
+ {
+
+ }
+
+
+#line 1078 "../../../../libs/parameter/doc/index.rst"
+int main()
+{
+#line 1075 "../../../../libs/parameter/doc/index.rst"
+def("f", &f, some_policies, "Documentation for f");
+def("f", &f, "Documentation for f", some_policies);
+
+#line 1088 "../../../../libs/parameter/doc/index.rst"
+def(
+ "f", &f
+ , _policies = some_policies, "Documentation for f");
+#line 1091 "../../../../libs/parameter/doc/index.rst"
+}
+

Added: trunk/libs/parameter/test/literate/deduced-template-parameters0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/deduced-template-parameters0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,111 @@
+
+#line 1524 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/noncopyable.hpp>
+#include <memory>
+
+using namespace boost::parameter;
+using boost::mpl::_;
+
+namespace boost { namespace python {
+
+BOOST_PARAMETER_TEMPLATE_KEYWORD(class_type)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(base_list)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(held_type)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(copyable)
+
+}}
+#line 1513 "../../../../libs/parameter/doc/index.rst"
+namespace boost { namespace python {
+
+namespace detail { struct bases_base {}; }
+
+template <class A0 = void, class A1 = void, class A2 = void >
+struct bases : detail::bases_base
+{};
+
+}}
+
+
+#line 1567 "../../../../libs/parameter/doc/index.rst"
+#include <boost/type_traits/is_class.hpp>
+namespace boost { namespace python {
+#line 1545 "../../../../libs/parameter/doc/index.rst"
+typedef parameter::parameters<
+ required<tag::class_type, is_class<_> >
+
+ , parameter::optional<
+ deduced<tag::base_list>
+ , is_base_and_derived<detail::bases_base,_>
+ >
+
+ , parameter::optional<
+ deduced<tag::held_type>
+ , mpl::not_<
+ mpl::or_<
+ is_base_and_derived<detail::bases_base,_>
+ , is_same<noncopyable,_>
+ >
+ >
+ >
+
+ , parameter::optional<deduced<tag::copyable>, is_same<noncopyable,_> >
+
+> class_signature;
+#line 1571 "../../../../libs/parameter/doc/index.rst"
+template <
+ class A0
+ , class A1 = parameter::void_
+ , class A2 = parameter::void_
+ , class A3 = parameter::void_
+>
+struct class_
+{
+ // Create ArgumentPack
+ typedef typename
+ class_signature::bind<A0,A1,A2,A3>::type
+ args;
+
+ // Extract first logical parameter.
+ typedef typename parameter::value_type<
+ args, tag::class_type>::type class_type;
+
+ typedef typename parameter::value_type<
+ args, tag::base_list, bases<> >::type base_list;
+
+ typedef typename parameter::value_type<
+ args, tag::held_type, class_type>::type held_type;
+
+ typedef typename parameter::value_type<
+ args, tag::copyable, void>::type copyable;
+};
+
+}}
+
+
+
+#line 1611 "../../../../libs/parameter/doc/index.rst"
+struct B {};
+struct D {};
+
+using boost::python::bases;
+#line 1607 "../../../../libs/parameter/doc/index.rst"
+typedef boost::python::class_<B, boost::noncopyable> c1;
+
+typedef boost::python::class_<D, std::auto_ptr<D>, bases<B> > c2;
+#line 1617 "../../../../libs/parameter/doc/index.rst"
+BOOST_MPL_ASSERT((boost::is_same<c1::class_type, B>));
+BOOST_MPL_ASSERT((boost::is_same<c1::base_list, bases<> >));
+BOOST_MPL_ASSERT((boost::is_same<c1::held_type, B>));
+BOOST_MPL_ASSERT((
+ boost::is_same<c1::copyable, boost::noncopyable>
+));
+
+BOOST_MPL_ASSERT((boost::is_same<c2::class_type, D>));
+BOOST_MPL_ASSERT((boost::is_same<c2::base_list, bases<B> >));
+BOOST_MPL_ASSERT((
+ boost::is_same<c2::held_type, std::auto_ptr<D> >
+));
+BOOST_MPL_ASSERT((boost::is_same<c2::copyable, void>));
+

Added: trunk/libs/parameter/test/literate/default-expression-evaluation0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/default-expression-evaluation0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,41 @@
+
+#line 730 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <iostream>
+
+BOOST_PARAMETER_NAME(graph)
+BOOST_PARAMETER_NAME(visitor)
+BOOST_PARAMETER_NAME(root_vertex)
+BOOST_PARAMETER_NAME(index_map)
+BOOST_PARAMETER_NAME(color_map)
+#line 702 "../../../../libs/parameter/doc/index.rst"
+#include <boost/graph/depth_first_search.hpp> // for dfs_visitor
+
+BOOST_PARAMETER_FUNCTION(
+ (void), depth_first_search, tag
+
+, (required
+ (graph, *)
+ (visitor, *)
+ (root_vertex, *)
+ (index_map, *)
+ (color_map, *)
+ )
+
+)
+{
+ std::cout << "graph=" << graph << std::endl;
+ std::cout << "visitor=" << visitor << std::endl;
+ std::cout << "root_vertex=" << root_vertex << std::endl;
+ std::cout << "index_map=" << index_map << std::endl;
+ std::cout << "color_map=" << color_map << std::endl;
+}
+
+int main()
+{
+ depth_first_search(1, 2, 3, 4, 5);
+
+ depth_first_search(
+ "1", '2', _color_map = '5',
+ _index_map = "4", _root_vertex = "3");
+}

Added: trunk/libs/parameter/test/literate/defining-the-keywords0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/defining-the-keywords0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,11 @@
+#line 397 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter/name.hpp>
+
+namespace graphs
+{
+ BOOST_PARAMETER_NAME(graph) // Note: no semicolon
+ BOOST_PARAMETER_NAME(visitor)
+ BOOST_PARAMETER_NAME(root_vertex)
+ BOOST_PARAMETER_NAME(index_map)
+ BOOST_PARAMETER_NAME(color_map)
+}

Added: trunk/libs/parameter/test/literate/defining-the-keywords1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/defining-the-keywords1.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,15 @@
+
+#line 424 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter/keyword.hpp>
+#line 413 "../../../../libs/parameter/doc/index.rst"
+namespace graphs
+{
+ namespace tag { struct graph; } // keyword tag type
+
+ namespace // unnamed
+ {
+ // A reference to the keyword object
+ boost::parameter::keyword<tag::graph>& _graph
+ = boost::parameter::keyword<tag::graph>::get();
+ }
+}

Added: trunk/libs/parameter/test/literate/exercising-the-code-so-far0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/exercising-the-code-so-far0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,101 @@
+
+#line 1382 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <memory>
+
+using namespace boost::parameter;
+
+namespace boost { namespace python {
+
+BOOST_PARAMETER_TEMPLATE_KEYWORD(class_type)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(base_list)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(held_type)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(copyable)
+
+template <class B = int>
+struct bases
+{};
+
+}}
+#line 1369 "../../../../libs/parameter/doc/index.rst"
+namespace boost { namespace python {
+
+using boost::mpl::_;
+
+typedef parameter::parameters<
+ required<tag::class_type, boost::is_class<_> >
+ , parameter::optional<tag::base_list, mpl::is_sequence<_> >
+ , parameter::optional<tag::held_type>
+ , parameter::optional<tag::copyable>
+> class_signature;
+
+}}
+
+#line 1421 "../../../../libs/parameter/doc/index.rst"
+namespace boost { namespace python {
+
+template <
+ class A0
+ , class A1 = parameter::void_
+ , class A2 = parameter::void_
+ , class A3 = parameter::void_
+>
+struct class_
+{
+ // Create ArgumentPack
+ typedef typename
+ class_signature::bind<A0,A1,A2,A3>::type
+ args;
+
+ // Extract first logical parameter.
+ typedef typename parameter::value_type<
+ args, tag::class_type>::type class_type;
+
+ typedef typename parameter::value_type<
+ args, tag::base_list, bases<> >::type base_list;
+
+ typedef typename parameter::value_type<
+ args, tag::held_type, class_type>::type held_type;
+
+ typedef typename parameter::value_type<
+ args, tag::copyable, void>::type copyable;
+};
+
+}}
+
+
+#line 1 "None"
+using boost::python::class_type;
+using boost::python::copyable;
+using boost::python::held_type;
+using boost::python::base_list;
+using boost::python::bases;
+
+struct B {};
+struct D {};
+#line 1462 "../../../../libs/parameter/doc/index.rst"
+typedef boost::python::class_<
+ class_type<B>, copyable<boost::noncopyable>
+> c1;
+
+typedef boost::python::class_<
+ D, held_type<std::auto_ptr<D> >, base_list<bases<B> >
+> c2;
+
+#line 1482 "../../../../libs/parameter/doc/index.rst"
+BOOST_MPL_ASSERT((boost::is_same<c1::class_type, B>));
+BOOST_MPL_ASSERT((boost::is_same<c1::base_list, bases<> >));
+BOOST_MPL_ASSERT((boost::is_same<c1::held_type, B>));
+BOOST_MPL_ASSERT((
+ boost::is_same<c1::copyable, boost::noncopyable>
+));
+
+BOOST_MPL_ASSERT((boost::is_same<c2::class_type, D>));
+BOOST_MPL_ASSERT((boost::is_same<c2::base_list, bases<B> >));
+BOOST_MPL_ASSERT((
+ boost::is_same<c2::held_type, std::auto_ptr<D> >
+));
+BOOST_MPL_ASSERT((boost::is_same<c2::copyable, void>));

Added: trunk/libs/parameter/test/literate/extracting-parameter-types0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/extracting-parameter-types0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,31 @@
+
+#line 1797 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <cassert>
+#line 1780 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_NAME(name)
+BOOST_PARAMETER_NAME(index)
+
+template <class Name, class Index>
+int deduce_arg_types_impl(Name& name, Index& index)
+{
+ Name& n2 = name; // we know the types
+ Index& i2 = index;
+ return index;
+}
+
+template <class ArgumentPack>
+int deduce_arg_types(ArgumentPack const& args)
+{
+ return deduce_arg_types_impl(args[_name], args[_index|42]);
+}
+#line 1801 "../../../../libs/parameter/doc/index.rst"
+int a1 = deduce_arg_types((_name = "foo"));
+int a2 = deduce_arg_types((_name = "foo", _index = 3));
+
+int main()
+{
+ assert(a1 == 42);
+ assert(a2 == 3);
+}
+

Added: trunk/libs/parameter/test/literate/extracting-parameter-types1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/extracting-parameter-types1.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,24 @@
+
+#line 1830 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <cassert>
+
+namespace parameter = boost::parameter;
+#line 1819 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_NAME(index)
+
+template <class ArgumentPack>
+typename parameter::value_type<ArgumentPack, tag::index, int>::type
+twice_index(ArgumentPack const& args)
+{
+ return 2 * args[_index|42];
+}
+
+int six = twice_index(_index = 3);
+#line 1838 "../../../../libs/parameter/doc/index.rst"
+int main()
+{
+ assert(six == 6);
+}
+

Added: trunk/libs/parameter/test/literate/fine-grained-name-control0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/fine-grained-name-control0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,18 @@
+
+#line 1670 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#line 1660 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_NAME((pass_foo, keywords) foo)
+
+BOOST_PARAMETER_FUNCTION(
+ (int), f,
+ keywords, (required (foo, *)))
+{
+ return foo + 1;
+}
+
+int x = f(pass_foo = 41);
+#line 1671 "../../../../libs/parameter/doc/index.rst"
+int main()
+{}
+

Added: trunk/libs/parameter/test/literate/handling-out-parameters0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/handling-out-parameters0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,33 @@
+
+#line 620 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+
+namespace boost
+{
+ int vertex_index = 0;
+
+ template <class T = int>
+ struct dfs_visitor
+ {};
+}
+
+BOOST_PARAMETER_NAME(graph)
+
+BOOST_PARAMETER_NAME(visitor)
+BOOST_PARAMETER_NAME(root_vertex)
+BOOST_PARAMETER_NAME(index_map)
+BOOST_PARAMETER_NAME(color_map)
+
+BOOST_PARAMETER_FUNCTION((void), f, tag,
+ (required (graph, *))
+#line 612 "../../../../libs/parameter/doc/index.rst"
+(optional
+ (visitor, *, boost::dfs_visitor<>())
+ (root_vertex, *, *vertices(graph).first)
+ (index_map, *, get(boost::vertex_index,graph))
+ (in_out(color_map), *,
+ default_color_map(num_vertices(graph), index_map) )
+)
+#line 642 "../../../../libs/parameter/doc/index.rst"
+) {}
+

Added: trunk/libs/parameter/test/literate/headers-and-namespaces0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/headers-and-namespaces0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,5 @@
+#line 274 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter/keyword.hpp>
+#line 283 "../../../../libs/parameter/doc/index.rst"
+using boost::parameter::keyword;
+

Added: trunk/libs/parameter/test/literate/lazy-default-computation0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/lazy-default-computation0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,27 @@
+
+#line 1878 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <string>
+
+namespace parameter = boost::parameter;
+#line 1861 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_NAME(s1)
+BOOST_PARAMETER_NAME(s2)
+BOOST_PARAMETER_NAME(s3)
+
+template <class ArgumentPack>
+std::string f(ArgumentPack const& args)
+{
+ std::string const& s1 = args[_s1];
+ std::string const& s2 = args[_s2];
+ typename parameter::binding<
+ ArgumentPack,tag::s3,std::string
+ >::type s3 = args[_s3|(s1+s2)]; // always constructs s1+s2
+ return s3;
+}
+
+std::string x = f((_s1="hello,", _s2=" world", _s3="hi world"));
+#line 1884 "../../../../libs/parameter/doc/index.rst"
+int main()
+{}
+

Added: trunk/libs/parameter/test/literate/lazy-default-computation1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/lazy-default-computation1.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,35 @@
+
+#line 1912 "../../../../libs/parameter/doc/index.rst"
+#include <boost/bind.hpp>
+#include <boost/ref.hpp>
+#include <boost/parameter.hpp>
+#include <string>
+#include <functional>
+
+namespace parameter = boost::parameter;
+
+BOOST_PARAMETER_NAME(s1)
+BOOST_PARAMETER_NAME(s2)
+BOOST_PARAMETER_NAME(s3)
+
+template <class ArgumentPack>
+std::string f(ArgumentPack const& args)
+{
+ std::string const& s1 = args[_s1];
+ std::string const& s2 = args[_s2];
+#line 1905 "../../../../libs/parameter/doc/index.rst"
+using boost::bind;
+using boost::ref;
+
+typename parameter::binding<
+ ArgumentPack, tag::s3, std::string
+>::type s3 = args[_s3 || bind(std::plus<std::string>(), ref(s1), ref(s2)) ];
+#line 1931 "../../../../libs/parameter/doc/index.rst"
+ return s3;
+}
+
+std::string x = f((_s1="hello,", _s2=" world", _s3="hi world"));
+
+int main()
+{}
+

Added: trunk/libs/parameter/test/literate/namespaces0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/namespaces0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,25 @@
+
+#line 2051 "../../../../libs/parameter/doc/index.rst"
+#line 2054 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <iostream>
+#line 2040 "../../../../libs/parameter/doc/index.rst"
+namespace lib
+{
+ BOOST_PARAMETER_NAME(name)
+ BOOST_PARAMETER_NAME(index)
+
+ BOOST_PARAMETER_FUNCTION(
+ (int), f, tag,
+ (optional (name,*,"bob")(index,(int),1))
+ )
+ {
+ std::cout << name << ":" << index << std::endl;
+ return index;
+ }
+}
+#line 2067 "../../../../libs/parameter/doc/index.rst"
+int x = lib::f(lib::_name = "jill", lib::_index = 1);
+#line 2071 "../../../../libs/parameter/doc/index.rst"
+int main() {}
+

Added: trunk/libs/parameter/test/literate/namespaces1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/namespaces1.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,28 @@
+
+#line 2069 "../../../../libs/parameter/doc/index.rst"
+#line 2054 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <iostream>
+#line 2040 "../../../../libs/parameter/doc/index.rst"
+namespace lib
+{
+ BOOST_PARAMETER_NAME(name)
+ BOOST_PARAMETER_NAME(index)
+
+ BOOST_PARAMETER_FUNCTION(
+ (int), f, tag,
+ (optional (name,*,"bob")(index,(int),1))
+ )
+ {
+ std::cout << name << ":" << index << std::endl;
+ return index;
+ }
+}
+#line 2080 "../../../../libs/parameter/doc/index.rst"
+using lib::_name;
+using lib::_index;
+
+int x = lib::f(_name = "jill", _index = 1);
+#line 2089 "../../../../libs/parameter/doc/index.rst"
+int main() {}
+

Added: trunk/libs/parameter/test/literate/namespaces2.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/namespaces2.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,26 @@
+
+#line 2083 "../../../../libs/parameter/doc/index.rst"
+#line 2054 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <iostream>
+#line 2040 "../../../../libs/parameter/doc/index.rst"
+namespace lib
+{
+ BOOST_PARAMETER_NAME(name)
+ BOOST_PARAMETER_NAME(index)
+
+ BOOST_PARAMETER_FUNCTION(
+ (int), f, tag,
+ (optional (name,*,"bob")(index,(int),1))
+ )
+ {
+ std::cout << name << ":" << index << std::endl;
+ return index;
+ }
+}
+#line 2097 "../../../../libs/parameter/doc/index.rst"
+using namespace lib;
+int x = f(_name = "jill", _index = 3);
+#line 2103 "../../../../libs/parameter/doc/index.rst"
+int main() {}
+

Added: trunk/libs/parameter/test/literate/namespaces3.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/namespaces3.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,29 @@
+
+#line 2130 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <iostream>
+#line 2112 "../../../../libs/parameter/doc/index.rst"
+namespace lib
+{
+ namespace keywords
+ {
+ BOOST_PARAMETER_NAME(name)
+ BOOST_PARAMETER_NAME(index)
+ }
+
+ BOOST_PARAMETER_FUNCTION(
+ (int), f, keywords::tag,
+ (optional (name,*,"bob")(index,(int),1))
+ )
+ {
+ std::cout << name << ":" << index << std::endl;
+ return index;
+ }
+}
+
+#line 2139 "../../../../libs/parameter/doc/index.rst"
+using namespace lib::keywords;
+int y = lib::f(_name = "bob", _index = 2);
+#line 2141 "../../../../libs/parameter/doc/index.rst"
+int main() {}
+

Added: trunk/libs/parameter/test/literate/optional-parameters0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/optional-parameters0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,31 @@
+
+#line 571 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+
+namespace boost
+{
+ int vertex_index = 0;
+
+ template <class T = int>
+ struct dfs_visitor
+ {};
+}
+
+BOOST_PARAMETER_NAME(graph)
+BOOST_PARAMETER_NAME(visitor)
+BOOST_PARAMETER_NAME(root_vertex)
+BOOST_PARAMETER_NAME(index_map)
+BOOST_PARAMETER_NAME(color_map)
+
+BOOST_PARAMETER_FUNCTION((void), f, tag,
+ (required (graph, *))
+#line 563 "../../../../libs/parameter/doc/index.rst"
+(optional (visitor, *, boost::dfs_visitor<>())
+ (root_vertex, *, *vertices(graph).first)
+ (index_map, *, get(boost::vertex_index,graph))
+ (in_out(color_map), *,
+ default_color_map(num_vertices(graph), index_map) )
+)
+#line 592 "../../../../libs/parameter/doc/index.rst"
+) {}
+

Added: trunk/libs/parameter/test/literate/parameter-enabled-constructors0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/parameter-enabled-constructors0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,37 @@
+
+#line 1215 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <iostream>
+#line 1201 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_NAME(name)
+BOOST_PARAMETER_NAME(index)
+
+struct myclass_impl
+{
+ template <class ArgumentPack>
+ myclass_impl(ArgumentPack const& args)
+ {
+ std::cout << "name = " << args[_name]
+ << "; index = " << args[_index | 42]
+ << std::endl;
+ }
+};
+
+#line 1228 "../../../../libs/parameter/doc/index.rst"
+struct myclass : myclass_impl
+{
+ BOOST_PARAMETER_CONSTRUCTOR(
+ myclass, (myclass_impl), tag
+ , (required (name,*)) (optional (index,*))) // no semicolon
+};
+
+
+#line 1242 "../../../../libs/parameter/doc/index.rst"
+int main() {
+#line 1239 "../../../../libs/parameter/doc/index.rst"
+myclass x("bob", 3); // positional
+myclass y(_index = 12, _name = "sally"); // named
+myclass z("june"); // positional/defaulted
+#line 1242 "../../../../libs/parameter/doc/index.rst"
+}
+

Added: trunk/libs/parameter/test/literate/parameter-enabled-member-functions0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/parameter-enabled-member-functions0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,17 @@
+
+#line 1121 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#include <iostream>
+using namespace boost::parameter;
+#line 1109 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_NAME(arg1)
+BOOST_PARAMETER_NAME(arg2)
+
+struct callable2
+{
+ BOOST_PARAMETER_CONST_MEMBER_FUNCTION(
+ (void), call, tag, (required (arg1,(int))(arg2,(int))))
+ {
+ std::cout << arg1 << ", " << arg2 << std::endl;
+ }
+};

Added: trunk/libs/parameter/test/literate/parameter-enabled-member-functions1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/parameter-enabled-member-functions1.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,18 @@
+
+#line 1144 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+
+BOOST_PARAMETER_NAME(arg1)
+BOOST_PARAMETER_NAME(arg2)
+using namespace boost::parameter;
+#line 1133 "../../../../libs/parameter/doc/index.rst"
+struct callable2
+{
+ BOOST_PARAMETER_CONST_MEMBER_FUNCTION(
+ (void), call, tag, (required (arg1,(int))(arg2,(int))))
+ {
+ call_impl(arg1,arg2);
+ }
+ private:
+ void call_impl(int, int); // implemented elsewhere.
+};

Added: trunk/libs/parameter/test/literate/predicate-requirements0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/predicate-requirements0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,84 @@
+
+#line 903 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+
+BOOST_PARAMETER_NAME((_graph, graphs) graph)
+BOOST_PARAMETER_NAME((_visitor, graphs) visitor)
+BOOST_PARAMETER_NAME((_root_vertex, graphs) root_vertex)
+BOOST_PARAMETER_NAME((_index_map, graphs) index_map)
+BOOST_PARAMETER_NAME((_color_map, graphs) color_map)
+
+using boost::mpl::_;
+
+namespace boost
+{
+ struct incidence_graph_tag {};
+ struct vertex_list_graph_tag {};
+
+ int vertex_index = 0;
+
+ template <class T>
+ struct graph_traits
+ {
+ typedef int traversal_category;
+ typedef int vertex_descriptor;
+ };
+
+ template <class T>
+ struct property_traits
+ {
+ typedef int value_type;
+ typedef int key_type;
+ };
+
+ template <class T = int>
+ struct dfs_visitor
+ {};
+}
+#line 859 "../../../../libs/parameter/doc/index.rst"
+BOOST_PARAMETER_FUNCTION(
+ (void), depth_first_search, graphs
+
+ , (required
+ (graph
+ , *(boost::mpl::and_<
+ boost::is_convertible<
+ boost::graph_traits<_>::traversal_category
+ , boost::incidence_graph_tag
+ >
+ , boost::is_convertible<
+ boost::graph_traits<_>::traversal_category
+ , boost::vertex_list_graph_tag
+ >
+ >) ))
+
+ (optional
+ (visitor, *, boost::dfs_visitor<>()) // not checkable
+
+ (root_vertex
+ , (typename boost::graph_traits<graphs::graph::_>::vertex_descriptor)
+ , *vertices(graph).first)
+
+ (index_map
+ , *(boost::mpl::and_<
+ boost::is_integral<
+ boost::property_traits<_>::value_type
+ >
+ , boost::is_same<
+ typename boost::graph_traits<graphs::graph::_>::vertex_descriptor
+ , boost::property_traits<_>::key_type
+ >
+ >)
+ , get(boost::vertex_index,graph))
+
+ (in_out(color_map)
+ , *(boost::is_same<
+ typename boost::graph_traits<graphs::graph::_>::vertex_descriptor
+ , boost::property_traits<_>::key_type
+ >)
+ , default_color_map(num_vertices(graph), index_map) )
+ )
+)
+#line 940 "../../../../libs/parameter/doc/index.rst"
+{}
+

Added: trunk/libs/parameter/test/literate/required-parameters0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/required-parameters0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,12 @@
+
+#line 540 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+
+BOOST_PARAMETER_NAME(graph)
+
+BOOST_PARAMETER_FUNCTION((void), f, tag,
+#line 531 "../../../../libs/parameter/doc/index.rst"
+(required (graph, *) )
+#line 547 "../../../../libs/parameter/doc/index.rst"
+) {}
+

Added: trunk/libs/parameter/test/literate/template-keywords0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/template-keywords0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,12 @@
+
+#line 1304 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#line 1296 "../../../../libs/parameter/doc/index.rst"
+namespace boost { namespace python {
+
+BOOST_PARAMETER_TEMPLATE_KEYWORD(class_type)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(base_list)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(held_type)
+BOOST_PARAMETER_TEMPLATE_KEYWORD(copyable)
+
+}}

Added: trunk/libs/parameter/test/literate/template-keywords1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/template-keywords1.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,13 @@
+
+#line 1320 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+#line 1311 "../../../../libs/parameter/doc/index.rst"
+namespace boost { namespace python {
+
+namespace tag { struct class_type; } // keyword tag type
+template <class T>
+struct class_type
+ : parameter::template_keyword<tag::class_type,T>
+{};
+
+}}

Added: trunk/libs/parameter/test/literate/top-level0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/top-level0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,40 @@
+
+#line 35 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter.hpp>
+
+namespace test
+{
+ BOOST_PARAMETER_NAME(title)
+ BOOST_PARAMETER_NAME(width)
+ BOOST_PARAMETER_NAME(titlebar)
+
+ BOOST_PARAMETER_FUNCTION(
+ (int), new_window, tag, (required (title,*)(width,*)(titlebar,*)))
+ {
+ return 0;
+ }
+
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(deleter)
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(copy_policy)
+
+ template <class T> struct Deallocate {};
+ struct DeepCopy {};
+
+ namespace parameter = boost::parameter;
+
+ struct Foo {};
+ template <class T, class A0, class A1>
+ struct smart_ptr
+ {
+ smart_ptr(Foo*);
+ };
+}
+using namespace test;
+int x =
+#line 19
+new_window("alert", _width=10, _titlebar=false);
+
+smart_ptr<
+ Foo
+ , deleter<Deallocate<Foo> >
+ , copy_policy<DeepCopy> > p(new Foo);

Added: trunk/libs/parameter/test/literate/writing-the-function0.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/parameter/test/literate/writing-the-function0.cpp 2009-01-28 18:33:37 EST (Wed, 28 Jan 2009)
@@ -0,0 +1,45 @@
+
+#line 472 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter/name.hpp>
+
+BOOST_PARAMETER_NAME(graph)
+BOOST_PARAMETER_NAME(visitor)
+BOOST_PARAMETER_NAME(root_vertex)
+BOOST_PARAMETER_NAME(index_map)
+BOOST_PARAMETER_NAME(color_map)
+
+namespace boost {
+
+template <class T = int>
+struct dfs_visitor
+{};
+
+int vertex_index = 0;
+
+}
+#line 446 "../../../../libs/parameter/doc/index.rst"
+#include <boost/parameter/preprocessor.hpp>
+
+namespace graphs
+{
+ BOOST_PARAMETER_FUNCTION(
+ (void), // 1. parenthesized return type
+ depth_first_search, // 2. name of the function template
+
+ tag, // 3. namespace of tag types
+
+ (required (graph, *) ) // 4. one required parameter, and
+
+ (optional // four optional parameters, with defaults
+ (visitor, *, boost::dfs_visitor<>())
+ (root_vertex, *, *vertices(graph).first)
+ (index_map, *, get(boost::vertex_index,graph))
+ (in_out(color_map), *,
+ default_color_map(num_vertices(graph), index_map) )
+ )
+ )
+ {
+ // ... body of function goes here...
+ // use graph, visitor, index_map, and color_map
+ }
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk