Boost logo

Boost :

From: Powell, Gary (powellg_at_[hidden])
Date: 2003-08-11 00:08:51


>-----Original Message-----
>From: Aleksey Gurtovoy [mailto:agurtovoy_at_[hidden]]
>Sent: Friday, August 08, 2003 4:27 AM
>To: Boost mailing list
>Subject: [boost] bind/lambda - unsupported use case?

>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 :)
>

>Aleksey

I'm a bit confused by your request,
 Do you want both fns to be called? in which case using <boost/lambda.hpp> and the operator,() between two bind statements?

as in:
  (bind(&post_command), bind(&show_warning, message_dialog(), _1) )

I haven't compiled it but it should call first the post_command, and then the show_warning with the argument.

  -Gary-


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