rvalues -> ref (yup... again!)
Johannes Pfau
nospam at example.com
Sat Mar 24 17:12:14 UTC 2018
Am Sat, 24 Mar 2018 17:10:53 +0000 schrieb Johannes Pfau:
> Am Sat, 24 Mar 2018 01:04:00 -0600 schrieb Jonathan M Davis:
>
>> As it stands, because a function can't accept rvalues by ref, it's
>> usually reasonable to assume that a function accepts its argument by
>> ref because it's mutating that argument rather than simply because it's
>> trying to avoid a copy. If ref suddenly starts accepting rvalues, then
>> we lose that.
>
> Any reason you can't simply use `ref` to imply 'modifies value' and
> `const ref` as 'passed by ref for performance reasons'?
Sorry, I see Manu already asked the same question.
--
Johannes
More information about the Digitalmars-d
mailing list