Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56321 - trunk/libs/proto/doc
From: eric_at_[hidden]
Date: 2009-09-20 11:09:29


Author: eric_niebler
Date: 2009-09-20 11:09:28 EDT (Sun, 20 Sep 2009)
New Revision: 56321
URL: http://svn.boost.org/trac/boost/changeset/56321

Log:
const-qualify return type of pow() function
Text files modified:
   trunk/libs/proto/doc/front_end.qbk | 8 ++++----
   1 files changed, 4 insertions(+), 4 deletions(-)

Modified: trunk/libs/proto/doc/front_end.qbk
==============================================================================
--- trunk/libs/proto/doc/front_end.qbk (original)
+++ trunk/libs/proto/doc/front_end.qbk 2009-09-20 11:09:28 EDT (Sun, 20 Sep 2009)
@@ -169,7 +169,7 @@
     typename proto::function<
         typename proto::terminal<pow_fun<Exp> >::type
       , Arg const &
- >::type
+ >::type const
     pow(Arg const &arg)
     {
         typedef
@@ -214,7 +214,7 @@
     typename proto::function<
         typename proto::terminal<pow_fun<Exp> >::type
       , Arg const & // <=== ERROR! This may not be a Proto type!
- >::type
+ >::type const
     pow(Arg const &arg)
 
 What we want is a way to make `Arg` into a Proto terminal if it is not a Proto expression already, and leave it alone if it is. For that, we can use _as_child_. The following implementation of the `pow()` function handles all argument types, expression templates or otherwise.
@@ -226,7 +226,7 @@
     typename proto::function<
         typename proto::terminal<pow_fun<Exp> >::type
       , typename proto::result_of::as_child<Arg const>::type
- >::type
+ >::type const
     pow(Arg const &arg)
     {
         typedef
@@ -255,7 +255,7 @@
         proto::tag::function // Tag type
       , pow_fun<Exp> // First child (by value)
       , Arg const & // Second child (by reference)
- >::type
+ >::type const
     pow(Arg const &arg)
     {
         return proto::make_expr<proto::tag::function>(


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