const member function synatx?

Janice Caron caron800 at googlemail.com
Sat Feb 16 06:42:02 PST 2008


On 16/02/2008, Frits van Bommel <fvbommel at remwovexcapss.nl> wrote:
> Janice Caron wrote:
>  > It is unusual ever to need to return a const(ReturnType), since why
>  > would you want to prevent the callee from modifying their copy of the
>  > return value?
>
>
> How about returning a class reference that you still have your own copy to?

Good point. I'd forgotten about that one.

Not that that makes any difference to im's original point, or to my
reply, of course. The unintuitive meaning of

    const ReturnType f(params...)

still remains.



More information about the Digitalmars-d mailing list