Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54068 - in branches/release: . boost/proto boost/proto/transform libs/proto/doc/reference/concepts libs/proto/doc/reference/transform
From: eric_at_[hidden]
Date: 2009-06-18 18:16:57


Author: eric_niebler
Date: 2009-06-18 18:16:56 EDT (Thu, 18 Jun 2009)
New Revision: 54068
URL: http://svn.boost.org/trac/boost/changeset/54068

Log:
Merged revisions 54067 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r54067 | eric_niebler | 2009-06-18 14:39:09 -0700 (Thu, 18 Jun 2009) | 1 line
  
  add a sensible default for proto::_default's template parameter
........

Properties modified:
   branches/release/ (props changed)
Text files modified:
   branches/release/boost/proto/proto_fwd.hpp | 5 +++++
   branches/release/boost/proto/transform/default.hpp | 11 ++++++++++-
   branches/release/libs/proto/doc/reference/concepts/BasicPrimitiveTransform.xml | 2 +-
   branches/release/libs/proto/doc/reference/transform/default.xml | 9 ++++++++-
   4 files changed, 24 insertions(+), 3 deletions(-)

Modified: branches/release/boost/proto/proto_fwd.hpp
==============================================================================
--- branches/release/boost/proto/proto_fwd.hpp (original)
+++ branches/release/boost/proto/proto_fwd.hpp 2009-06-18 18:16:56 EDT (Thu, 18 Jun 2009)
@@ -188,6 +188,8 @@
         ///
         #define BOOST_PROTO_UNCVREF(X) \
             typename boost::remove_const<typename boost::remove_reference<X>::type>::type
+
+ struct _default;
     }
 
     typedef detail::ignore const ignore;
@@ -744,6 +746,9 @@
     template<typename Grammar>
     struct pass_through;
 
+ template<typename Grammar = detail::_default>
+ struct _default;
+
     struct _expr;
     struct _state;
     struct _data;

Modified: branches/release/boost/proto/transform/default.hpp
==============================================================================
--- branches/release/boost/proto/transform/default.hpp (original)
+++ branches/release/boost/proto/transform/default.hpp 2009-06-18 18:16:56 EDT (Thu, 18 Jun 2009)
@@ -31,7 +31,7 @@
 
     namespace boost { namespace proto
     {
- template<typename Grammar>
+ template<typename Grammar BOOST_PROTO_WHEN_BUILDING_DOCS(= detail::_default)>
         struct _default
           : transform<_default<Grammar> >
         {
@@ -463,6 +463,15 @@
           : mpl::true_
         {};
 
+ namespace detail
+ {
+ // Loopy indirection that allows proto::_default<> to be
+ // used without specifying a Grammar argument.
+ struct _default
+ : proto::_default<>
+ {};
+ }
+
     }}
 
     #endif

Modified: branches/release/libs/proto/doc/reference/concepts/BasicPrimitiveTransform.xml
==============================================================================
--- branches/release/libs/proto/doc/reference/concepts/BasicPrimitiveTransform.xml (original)
+++ branches/release/libs/proto/doc/reference/concepts/BasicPrimitiveTransform.xml 2009-06-18 18:16:56 EDT (Thu, 18 Jun 2009)
@@ -18,7 +18,7 @@
 
   <description>
     <para>
- A PrimitiveTransform is class type that
+ A BasicPrimitiveTransform is class type that
       has a nested class template called impl that takes
       three template parameters representing an expression
       type, a state type and a data type. Specializations

Modified: branches/release/libs/proto/doc/reference/transform/default.xml
==============================================================================
--- branches/release/libs/proto/doc/reference/transform/default.xml (original)
+++ branches/release/libs/proto/doc/reference/transform/default.xml 2009-06-18 18:16:56 EDT (Thu, 18 Jun 2009)
@@ -4,7 +4,9 @@
     <namespace name="proto">
       <struct name="_default">
         <template>
- <template-type-parameter name="Grammar"/>
+ <template-type-parameter name="Grammar">
+ <default><replaceable>unspecified</replaceable></default>
+ </template-type-parameter>
         </template>
         <inherit><classname>proto::transform</classname>&lt; _default&lt;Grammar&gt; &gt;</inherit>
         <purpose>A <conceptname>PrimitiveTransform</conceptname> that gives expressions their
@@ -16,6 +18,11 @@
               <classname>proto::_default::impl&lt;&gt;</classname>
             </computeroutput> class template.
           </para>
+ <para>
+ When used without specifying a <computeroutput>Grammar</computeroutput> parameter,
+ <computeroutput>proto::_default</computeroutput> behaves as if the parameter were
+ <computeroutput>proto::_default&lt;&gt;</computeroutput>.
+ </para>
         </description>
         <struct name="impl">
           <template>


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