Boost logo

Boost Users :

Subject: Re: [Boost-users] boost bind example does not compile with member template function on gcc 4.0
From: Stuart Dootson (stuart.dootson_at_[hidden])
Date: 2009-07-15 03:21:23


On Tue, Jul 14, 2009 at 7:37 PM, James Pritts<jbpritts_at_[hidden]> wrote:
> Unfortunately I cannot grok boost::bind error, but this code seems really
> simple.  If I change the code so that an int is passed to async_discovery,
> the program compiles.  The problem seems to be centered around passing a
> boost::bind as a template argument.  Any help would be appreciated.
>

<snip>

>
> -Jimmy.

I can offer a solution rather than an explanation - make the
compiler's job that bit easier by putting a boost::function in to
simplify the template parameter:

  ads.async_discovery(boost::function<void()>(boost::bind(&test::do_it, t)));

Compiles under Visual C++ 9.0

Stuart Dootson


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