Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80265 - trunk/libs/proto/example
From: eric_at_[hidden]
Date: 2012-08-27 17:42:59


Author: eric_niebler
Date: 2012-08-27 17:42:59 EDT (Mon, 27 Aug 2012)
New Revision: 80265
URL: http://svn.boost.org/trac/boost/changeset/80265

Log:
fix example
Text files modified:
   trunk/libs/proto/example/virtual_member.cpp | 42 ++++++++++++++++++++--------------------
   1 files changed, 21 insertions(+), 21 deletions(-)

Modified: trunk/libs/proto/example/virtual_member.cpp
==============================================================================
--- trunk/libs/proto/example/virtual_member.cpp (original)
+++ trunk/libs/proto/example/virtual_member.cpp 2012-08-27 17:42:59 EDT (Mon, 27 Aug 2012)
@@ -87,27 +87,7 @@
     }
 
     // Forward declaration for the mini-lambda grammar
- struct grammar;
-
- // A callable PolymorphicFunctionObject that evaluates
- // if/then/else expressions.
- struct eval_if_else : proto::callable
- {
- typedef void result_type;
-
- template<typename If, typename Then, typename Else, typename Args>
- void operator()(If const &if_, Then const &then_, Else const &else_, Args const &args) const
- {
- if(grammar()(if_, 0, args))
- {
- grammar()(then_, 0, args);
- }
- else
- {
- grammar()(else_, 0, args);
- }
- }
- };
+ struct eval_if_else;
 
     // Forward declaration for the mini-lambda expression wrapper
     template<class E>
@@ -156,6 +136,26 @@
>
     {};
 
+ // A callable PolymorphicFunctionObject that evaluates
+ // if/then/else expressions.
+ struct eval_if_else : proto::callable
+ {
+ typedef void result_type;
+
+ template<typename If, typename Then, typename Else, typename Args>
+ void operator()(If const &if_, Then const &then_, Else const &else_, Args const &args) const
+ {
+ if(grammar()(if_, 0, args))
+ {
+ grammar()(then_, 0, args);
+ }
+ else
+ {
+ grammar()(else_, 0, args);
+ }
+ }
+ };
+
     // Define the mini-lambda domain, in which all expressions are
     // wrapped in mini_lambda::expression.
     struct domain


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