Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69234 - sandbox/SOC/2010/phoenix3/libs/phoenix/example
From: thom.heller_at_[hidden]
Date: 2011-02-24 02:57:54


Author: theller
Date: 2011-02-24 02:57:46 EST (Thu, 24 Feb 2011)
New Revision: 69234
URL: http://svn.boost.org/trac/boost/changeset/69234

Log:
fixed invert example for MSVC
Text files modified:
   sandbox/SOC/2010/phoenix3/libs/phoenix/example/invert.cpp | 27 ++++++++++++++++++---------
   1 files changed, 18 insertions(+), 9 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/libs/phoenix/example/invert.cpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/libs/phoenix/example/invert.cpp (original)
+++ sandbox/SOC/2010/phoenix3/libs/phoenix/example/invert.cpp 2011-02-24 02:57:46 EST (Thu, 24 Feb 2011)
@@ -7,7 +7,6 @@
 ==============================================================================*/
 
 #include <boost/phoenix/phoenix.hpp>
-#include <boost/phoenix/operator.hpp>
 #include <boost/proto/proto.hpp>
 #include <boost/proto/debug.hpp>
 
@@ -22,12 +21,18 @@
     {};
 };
 
+using phoenix::evaluator;
+
+#ifdef _MSC_VER
+#define evaluator(A0, A1) proto::call<phoenix::evaluator(A0, A1)>
+#endif
+
 template <>
 struct invert_actions::when<phoenix::rule::plus>
     : proto::call<
         proto::functional::make_expr<proto::tag::minus>(
- phoenix::evaluator(proto::_left, phoenix::_context)
- , phoenix::evaluator(proto::_right, phoenix::_context)
+ evaluator(proto::_left, phoenix::_context)
+ , evaluator(proto::_right, phoenix::_context)
         )
>
 {};
@@ -36,8 +41,8 @@
 struct invert_actions::when<phoenix::rule::minus>
     : proto::call<
         proto::functional::make_expr<proto::tag::plus>(
- phoenix::evaluator(proto::_left, phoenix::_context)
- , phoenix::evaluator(proto::_right, phoenix::_context)
+ evaluator(proto::_left, phoenix::_context)
+ , evaluator(proto::_right, phoenix::_context)
         )
>
 {};
@@ -46,8 +51,8 @@
 struct invert_actions::when<phoenix::rule::multiplies>
     : proto::call<
         proto::functional::make_expr<proto::tag::divides>(
- phoenix::evaluator(proto::_left, phoenix::_context)
- , phoenix::evaluator(proto::_right, phoenix::_context)
+ evaluator(proto::_left, phoenix::_context)
+ , evaluator(proto::_right, phoenix::_context)
         )
>
 {};
@@ -56,12 +61,16 @@
 struct invert_actions::when<phoenix::rule::divides>
     : proto::call<
         proto::functional::make_expr<proto::tag::multiplies>(
- phoenix::evaluator(proto::_left, phoenix::_context)
- , phoenix::evaluator(proto::_right, phoenix::_context)
+ evaluator(proto::_left, phoenix::_context)
+ , evaluator(proto::_right, phoenix::_context)
         )
>
 {};
 
+#ifdef _MSC_VER
+#undef evaluator
+#endif
+
 template <typename Expr>
 void print_expr(Expr const & expr)
 {


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