rvalues -> ref (yup... again!)

Timon Gehr timon.gehr at gmx.ch
Sat Mar 24 03:19:55 UTC 2018


On 24.03.2018 04:14, Manu wrote:
> On 23 March 2018 at 20:03, Timon Gehr via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
>> On 24.03.2018 01:35, Manu wrote:
>>>
>>> Okay, let's read 'const ref' every time I say 'ref'. I thought that
>>> would be fairly safe to assume. Sorry!
>>
>>
>> Absolutely not. It makes absolutely no sense to restrict rvalue references
>> to const objects. (Recall that const is transitive and actually prevents
>> mutation. This is not C++.)
> 
> We're not talking about rvalue-references... were talking about
> not-rvalue-references to temporaries.
> 

Let me rephrase:

Absolutely not. It makes absolutely no sense to force const for 
not-rvalue-references to temporaries. (Recall that const is transitive 
and actually prevents mutation. This is not C++.)


More information about the Digitalmars-d mailing list