Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-12-01 20:32:15


Author: eric_niebler
Date: 2007-12-01 20:32:15 EST (Sat, 01 Dec 2007)
New Revision: 41560
URL: http://svn.boost.org/trac/boost/changeset/41560

Log:
transforms now use the result_of protocol
Text files modified:
   branches/proto/v3/boost/xpressive/proto/traits.hpp | 11 +++++++----
   branches/proto/v3/libs/xpressive/proto/example/calc3.cpp | 2 +-
   2 files changed, 8 insertions(+), 5 deletions(-)

Modified: branches/proto/v3/boost/xpressive/proto/traits.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/traits.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/traits.hpp 2007-12-01 20:32:15 EST (Sat, 01 Dec 2007)
@@ -113,15 +113,18 @@
             typedef expr<tag::terminal, term<T> > type;
             typedef type proto_base_expr;
 
- template<typename Expr, typename, typename>
- struct apply
+ template<typename Sig>
+ struct result;
+
+ template<typename This, typename Expr, typename State, typename Visitor>
+ struct result<This(Expr, State, Visitor)>
             {
                 typedef Expr type;
             };
 
             template<typename Expr, typename State, typename Visitor>
- static Expr const &
- call(Expr const &expr, State const &, Visitor &)
+ Expr const &
+ operator()(Expr const &expr, State const &, Visitor &) const
             {
                 return expr;
             }

Modified: branches/proto/v3/libs/xpressive/proto/example/calc3.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/example/calc3.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/example/calc3.cpp 2007-12-01 20:32:15 EST (Sat, 01 Dec 2007)
@@ -55,7 +55,7 @@
 // is not used, is mpl::void_.
 template<typename Expr>
 struct calculator_arity
- : CalculatorGrammar::apply<Expr, zero, mpl::void_>
+ : boost::result_of<CalculatorGrammar(Expr, zero, mpl::void_)>
 {};
 
 // For expressions in the calculator domain, operator()


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