Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Function and Boost.Bind
From: Yang Zhang (yanghatespam_at_[hidden])
Date: 2008-11-20 11:17:25


Steven Watanabe wrote:
> AMDG
>
> Yang Zhang wrote:
>> // ...but this does not compile.
>> // bind(twice, bind(show, 0))();
>
> #include <boost/bind/protect.hpp>
>
> ...
>
> bind(twice, protect(bind(show, 0)))

Thanks, this works. Would anybody be able to explain what just
happened? According to:

http://www.boost.org/doc/libs/1_37_0/libs/bind/bind.html#nested_binds

this is supposed to prevent something from being evaluated, but I can't
tell what precisely was going on. I believe my question of
understanding also ties into why their `apply` example was necessary.

>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

-- 
Yang Zhang
http://www.mit.edu/~y_z/

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