[phoenix] Simple bind example not compiling

Hi all, I am trying to compile the phoenix::bind example partially laid out here: http://www.boost.org/doc/libs/1_47_0/libs/phoenix/doc/html/phoenix/modules/b... The code, with #includes and using decls added, is: ========== #include <boost/phoenix/bind/bind_function.hpp> #include <boost/phoenix/core/argument.hpp> #include <iostream> using namespace boost::phoenix; using namespace boost::phoenix::placeholders; void foo(int n) { std::cout << n << std::endl; } int main() { bind(&foo, arg1)(4); } ========== However, the compiler (g++ 4.4.5) complains: /home/gredner/main.cpp: In function ‘int main()’: /home/gredner/main.cpp:16: error: no matching function for call to ‘bind(void (*)(int), const boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<1> >, 0l> >&)’ What am I doing wrong? I also tried fully-qualifying 'bind' and 'arg1', but got the same results. Also, there is no simple bind example under libs/phoenix/examples - in light of this sort of problem, it would be very nice to have one. Thanks, -Gabe

2011/8/14 Gabriel Redner <gredner@gmail.com>
Hi all,
I am trying to compile the phoenix::bind example partially laid out here:
http://www.boost.org/doc/libs/1_47_0/libs/phoenix/doc/html/phoenix/modules/b...
The code, with #includes and using decls added, is:
========== #include <boost/phoenix/bind/bind_function.hpp> #include <boost/phoenix/core/argument.hpp>
#include <iostream>
using namespace boost::phoenix; using namespace boost::phoenix::placeholders;
void foo(int n) { std::cout << n << std::endl; }
int main() { bind(&foo, arg1)(4); } ==========
However, the compiler (g++ 4.4.5) complains:
/home/gredner/main.cpp: In function ‘int main()’: /home/gredner/main.cpp:16: error: no matching function for call to ‘bind(void (*)(int), const
boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<1> >, 0l> >&)’
What am I doing wrong? I also tried fully-qualifying 'bind' and 'arg1', but got the same results.
I think it's a bug in <boost/phoenix/bind/bind_function.hpp>. Patch attached.

Indeed, that patch fixes the problem. Thanks! Is there a ticket filed about this problem? -Gabe

2011/8/15 Gabriel Redner <gredner@gmail.com>
Indeed, that patch fixes the problem. Thanks! Is there a ticket filed about this problem?
Now filed. https://svn.boost.org/trac/boost/ticket/5782

On Monday, August 15, 2011 02:11:11 AM TONGARI wrote:
2011/8/15 Gabriel Redner <gredner@gmail.com>
Indeed, that patch fixes the problem. Thanks! Is there a ticket filed about this problem?
Now filed. https://svn.boost.org/trac/boost/ticket/5782 Fixed on trunk. Thanks for reporting
participants (3)
-
Gabriel Redner
-
Thomas Heller
-
TONGARI