`const ref T` or `ref const T`?
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Thu Aug 15 15:18:00 UTC 2024
On Thursday, August 15, 2024 8:56:29 AM MDT Richard (Rikki) Andrew Cattermole
via Digitalmars-d wrote:
> On 16/08/2024 2:47 AM, Jonathan M Davis wrote:
> > Either way, the person to convince would be Walter, and based on past
> > discussions of this sort, I doubt that he'll be convinced, but who knows.
> > It can sometimes be quite surprising what he does or doesn't agree with,
> > and it's not like he never changes his mind.
>
> Considering that he allowed the abomination that is return and scope
> ordering to result in two different attributes, it's worth talking with
> him about it I'd say!
That is indeed an abomination, and I'd love to see that fixed (though
honestly, I'd love to see DIP 1000 thrown out entirely), but it's a very
different situation from const ref vs ref const. The problem with
return scope vs scope return is that it not only makes the order matter, but
it makes it so that each order means different things. On the other hand,
requiring ref const would be requiring a fixed order when we have no need to
do so, and both orders are currently fine.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list