Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2004-05-06 18:58:52


On Thursday 06 May 2004 05:32 pm, Dill, John wrote:
> I believe that this can be done, but doesn't justify whether it should be
> done. There are several issues that I see at the moment.
>
> A. Changes the semantics of everyone's bind and mem_fn, no biggy there
> ;-). B. Pass by value is silent, not sure how many copies of the argument
> will be generated if pass-by-value.
>
> But at the same time there is an advantage.
>
> a. You can use literals in calling your bind functions.
>
> What do you all think?

I don't like the change.

Ideally, bind(f, _1, _2, _3)(x, y, z) would be exactly equivalent to f(x, y,
z). The current bind() implementation gives us nearly this equivalence
because it passes by reference, except that we get a failure at compile time
if one tries to pass a literal. Going to passing by value would take us
further from that ideal equivalence.

        Doug


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