|
Boost Users : |
Subject: Re: [Boost-users] [phoenix] Simple bind example not compiling
From: TONGARI (tongari95_at_[hidden])
Date: 2011-08-14 11:56:49
2011/8/14 Gabriel Redner <gredner_at_[hidden]>
> 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.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net