On 2/15/2012 03:57, Mathias Gaunard wrote:
You're using Phoenix v2, which doesn't support rvalues and also has many type deduction problems. Try v3.
Thanks! Upgrading to Version 1.49.0 beta 1 fixed the Application-to-RValues part. Now, to the proper-type-name for passing & storage part. I've tried the following and it works: auto newActor() -> decltype((arg1 % 2 == 1)) { return (arg1 % n == 0); } auto f = (arg1 % 2 == 1); auto g = f; g = newActor(); I can find out the type name using non-portable typeid(Variable).name(), but the output is somewhat inconvenient (quoted below). Is there a nice-to-type solution? It'd be esp. useful for non-C++11 compiler, where I cannot use trailing-return-type for "newActor" function nor type deduction for "f" and "g" variables -- what's the suggested type in this situation? I've realized that using boost::function (or std::function) won't work either, since it's monomorphic (while one of the reasons I'm looking at Boost.Phoenix is polymorphic lambdas). Type name: struct boost::phoenix::actor < struct boost::proto::exprns_::basic_expr < struct boost::proto::tagns_::tag::equal_to, struct boost::proto::argsns_::list2 < struct boost::phoenix::actor < struct boost::proto::exprns_::basic_expr < struct boost::proto::tagns_::tag::modulus, struct boost::proto::argsns_::list2 < struct boost::phoenix::actor < struct boost::proto::exprns_::basic_expr < struct boost::proto::tagns_::tag::terminal, struct boost::proto::argsns_::term < struct boost::phoenix::argument<1> >, 0 > >, struct boost::phoenix::actor < struct boost::proto::exprns_::basic_expr < struct boost::proto::tagns_::tag::terminal, struct boost::proto::argsns_::term<int>, 0 > > >, 2 > >, struct boost::phoenix::actor < struct boost::proto::exprns_::basic_expr < struct boost::proto::tagns_::tag::terminal, struct boost::proto::argsns_::term<int>, 0 > > >, 2
Best, Matt