Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2008-04-20 09:13:42


Author: hkaiser
Date: 2008-04-20 09:13:42 EDT (Sun, 20 Apr 2008)
New Revision: 44623
URL: http://svn.boost.org/trac/boost/changeset/44623

Log:
Spirit.Lex: Changed wrap_action::phoenix_action to be a embedded function object. Same errors still...
Text files modified:
   trunk/boost/spirit/home/lex/lexer/lexertl/wrap_action.hpp | 46 ++++++++++++++++++++++++++-------------
   1 files changed, 31 insertions(+), 15 deletions(-)

Modified: trunk/boost/spirit/home/lex/lexer/lexertl/wrap_action.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/lexertl/wrap_action.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/lexertl/wrap_action.hpp 2008-04-20 09:13:42 EDT (Sun, 20 Apr 2008)
@@ -30,27 +30,43 @@
         }
 
         // wrap phoenix actor, make sure first argument is a fusion sequence
- template <typename Eval>
- static void phoenix_action(phoenix::actor<Eval> const& f,
- Attribute const& attr, std::size_t id, bool& pass, Context& ctx)
- {
- f(spirit::detail::pass_value<Attribute const>::call(attr), id, pass, ctx);
- }
+// template <typename Eval>
+// static void phoenix_action(phoenix::actor<Eval> const& f,
+// Attribute const& attr, std::size_t id, bool& pass, Context& ctx)
+// {
+// f(spirit::detail::pass_value<Attribute const>::call(attr), id, pass, ctx);
+// }
+
+ struct phoenix_action
+ {
+ template <typename F, typename T1, typename T2, typename T3, typename T4>
+ struct result { typedef void type; };
+
+ template <typename Eval>
+ void
+ operator()(phoenix::actor<Eval> const& f, Attribute const& attr,
+ std::size_t id, bool& pass, Context& ctx) const
+ {
+ f(spirit::detail::pass_value<Attribute const>::call(attr), id, pass, ctx);
+ }
+ };
 
         template <typename Eval>
         static FunctionType call(phoenix::actor<Eval> const& f)
         {
- using phoenix::arg_names::arg1;
- using phoenix::arg_names::arg2;
- using phoenix::arg_names::arg3;
- using phoenix::arg_names::arg4;
-
- void (*pf)(phoenix::actor<Eval> const&,
- Attribute const&, std::size_t, bool&, Context&) =
- &wrap_action::phoenix_action;
+ using phoenix::arg_names::arg1;
+ using phoenix::arg_names::arg2;
+ using phoenix::arg_names::arg3;
+ using phoenix::arg_names::arg4;
 
- return phoenix::bind(pf, f, arg1, arg2, arg3, arg4);
+// void (*pf)(phoenix::actor<Eval> const&,
+// Attribute const&, std::size_t, bool&, Context&) =
+// &wrap_action::phoenix_action;
+//
+// return phoenix::bind(pf, f, arg1, arg2, arg3, arg4);
 
+ return phoenix::bind(phoenix_action(), f, arg1, arg2, arg3, arg4);
+
             //~ return boost::bind(
                 //~ &wrap_action::phoenix_action<Eval>, f, _1, _2, _3, _4);
         }


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