Can we enable -preview=rvaluereference now?

Steven Schveighoffer schveiguy at gmail.com
Sat Aug 17 01:10:39 UTC 2024


On Saturday, 17 August 2024 at 00:11:35 UTC, Manu wrote:
> On Sat, 17 Aug 2024, 09:36 Quirin Schroll via Digitalmars-d, < 
> digitalmars-d at puremagic.com> wrote:
>> Can we please remove it? It's a silent breaking change as it 
>> changes the semantics of every function that has `ref` 
>> parameters with the implicit or explicit understanding that it 
>> can't take rvalues. Add `@universal ref`. It's a pure addition 
>> and wouldn't break code. Manu and others could just search and 
>> replace `ref` by `@universal ref` and be happy. Changing `ref` 
>> to make it take rvalues never was a good idea.
>>
>
> I think you need to present a rock solid case to invalidate 
> half a decade of several people's work, and you'll have to do 
> better then "I don't care for that in theory", or "the idea 
> kind-of makes me nervous despite never having turned the flag 
> on and having literally no experience with it one way or the 
> other"...

Keep in mind that everyone has been using rvalue references with 
struct member functions forever, with very few complaints. This 
is what convinced me that it's fine.

-Steve


More information about the Digitalmars-d mailing list