Boost logo

Boost :

From: Philippe Mori (philippe_mori_at_[hidden])
Date: 2005-04-28 13:37:46


>>
>> Which item # are you referring at page 91? It seems like some
>> important changes were made between both editions.
>>
> Sorry, the item is #21: "Use const whenever possible". Yes, there are
> probably some changes between editions. That may be the reason that the
> Boost Guidelines explicitly refer to the second edition. I wouldn't know,
> though. I have never seen the first edition.
>
> --
> Søren

In edition 1, he mentions it is possible to returns a const object
but none of the example are related to that and his examples
does not have top-level const qualifier. That is, he uses

    const char *

and not

    const char * const

for the return value.

I don't knows about edition 2...

In pratice, const is seldom used for return value and for arguments
as it provide not as much benefice in those cases as the effect is
local.

Philippe


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