Boost logo

Boost :

From: Hartmut Kaiser (hartmutkaiser_at_[hidden])
Date: 2004-01-11 03:54:53


Howard Hinnant wrote:

> Andrei was making a point that Peter's test does not elucidate.
>
> If you must modify the argument internally, then it is better
> to pass the argument by value and modify the argument
> directly, rather than pass by const reference, and make a
> copy of the argument which you can then modify:

[snipped code sample]

> Design A saves a copy over design B when client code passes a
> temporary.

Sure, you're right. But this isn't the case in iterator_adaptor.

Now, that we've agreed on the usefulness of a const reference for the
iterator_adaptor constructor (haven't we?), should I go ahead changing it in
the CVS?

Regards Hartmut


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