Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-08-11 22:54:40


Gary Powell wrote:
> >Consider the following snippet:
> >
> > void show_warning( message_dialog const&, user_message );
> > void post_command( boost::function<void()> );
> >
> > int main()
> > {
> > boost::function<void( user_message )> f(
> > bind( &post_command
> > , ????( bind( &show_warning, message_dialog(), _1 ) )
> > // ^^^^ what goes here?
> > )
> > );
> > }
> >
> >Could we make it work, somehow? Offers of a hand-written function
> >performing the composition are not accepted :)
> >
>
> I'm a bit confused by your request,
> Do you want both fns to be called?

Nope. Please see http://article.gmane.org/gmane.comp.lib.boost.devel/23466
for the semantics clarification. Basically, I want the whole bind
expression to return an unary function object which, when invoked, will
use the argument to construct a nested nullary function object:

    bind( &show_warning, message_dialog(), <arg> )

and pass it as an argument to 'post_command'.

Does it make more sense now?

Aleksey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk