Boost logo

Boost :

From: Miro Jurisic (macdev_at_[hidden])
Date: 2004-04-07 13:31:42


In article <c51662$3lh$1_at_[hidden]>,
 "Edward Diener" <eddielee_at_[hidden]> wrote:

> In the first line of the next to last paragraph of the boost::bind
> deocumentation under the heading of "Using nested binds for function
> composition", it is stated:
>
> "Sometimes it is necessary not to evaluate the first argument, but not to
> evaluate some of the other arguments, even when they are nested bind
> subexpressions. "
>
> I believe this is confusing and that a much clearer explanation of what is
> meant would be:
>
> "Although the first argument is, by default, not evaluated, all other
> arguments are. Sometimes it is necessary not to evaluate arguments
> subsequent to the first, even when they are nested bind subexpressions."

Except that's not true. All arguments are evaluated, that's how C++ works; the
difference is that the first argument is the functor, and it's desirable to
evaluate it, and the remaining arguments are arguments, and it's often desirable
to defer their evaluation until the bound call is actually made.

That said, I agree, that part of the documentation should be clarified. The only
reason I know this material is that I spent 3 hours on a compiler error that was
ostensibly explained in that paragraph, but the paragraph didn't make sense
until I painfully discovered the material myself.

meeroh

-- 
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

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