[phoenix2][asio] phoenix bind does not work with asio

Hi, I am trying to replace all occurrences of boost.bind with phoenix bind, since boost.bind is unusable due to the placeholders not residing in a named namespace. However, asio always fails to compile when used with phoenix bind. The error message always goes like "boost/asio/detail/bind_handler.hpp:130: error: no matching function for call to ‘invoke(const boost::asio::detail::binder2<boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::detail::function_eval<4>, ....." I suspect this is because phoenix bind creates an actor, not a boost function object. This problem is present in boost trunk as well. Does anybody have an idea how to solve this?

Carlos Rafael Giani wrote:
An actor is a function object.
Does anybody have an idea how to solve this?
Please provide a minimal cpp file we can try. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Hi, I've created ticket for this problem some time ago: https://svn.boost.org/trac/boost/ticket/2977: boost.phoenix cannot be used with asio to create handlers. phoenix functors has overloaded operator &, and asio cannot allocate new handler. ASIO should use boost::addressof instead of &, while allocating handlers. Best Regards, Sergei

Nevermind, it is a problem in asio. Sergei Politov created a ticker for this a while ago ( https://svn.boost.org/trac/boost/ticket/2977 ). Joel de Guzman wrote:
participants (3)
-
Carlos Rafael Giani
-
Joel de Guzman
-
Sergei Politov