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/bind/binding_functions.html
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.