Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2004-02-19 14:28:01


(Regarding reference versus value...)

On Thu, Feb 19, 2004 at 02:06:15PM -0300, Fernando Cacciola wrote:
> Though the problems you're addressing are real I think the solution is not
> to ban reference paramaters altoghether along the entire functoid taxonomy
> but to prescribe the following rule:
>
> first-order functoids can take parameters by value or by reference.
> high-order functoids should take parameteres only by value (but ref() can be
> used by the caller to denote a reference)
>
> Assuming app follows the rule above:
>
> app(_,3)(f);
> app(_,x)(g); // compile-time error, cannot bound a reference to a
> temporary.
> app(_,ref(x))(g); // ok

This might be a very good compromise. It will take some time for me to
consider all of the implications.

-- 
-Brian McNamara (lorgon_at_[hidden])

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