auto ref is on the docket
kinke via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jun 22 16:27:52 PDT 2015
On Monday, 22 June 2015 at 23:04:14 UTC, Timon Gehr wrote:
> On 06/23/2015 12:18 AM, kinke wrote:
>>>> In C++ there's no problem with const&, so why they will be
>>>> in D?
>>>
>>> Because const is transitive in D and therefore more
>>> restrictive.
>>
>> That's not a reason.
>
> Yes it is.
>
>> It's just an additional restriction imposed by D and only
>> prevents
>> you from using the proposed `in ref T`/`const auto ref T`
>> *shudder*
>> equivalents if const-transitiveness would be violated. In my
>> day-to-day C++ work, I almost never have to do that.
>
> Note "almost".
Ah, I remember you from another rvalue discussion some years ago.
;)
Care to share an example where transitive const is a problem
apart from obvious lazily caching stuff? I don't think I've
encountered any lately.
More information about the Digitalmars-d
mailing list