RfC for language feature: rvalue struct

FeepingCreature feepingcreature at gmail.com
Wed Jan 25 21:04:34 UTC 2023


On Wednesday, 25 January 2023 at 17:09:18 UTC, Basile B. wrote:
> On Wednesday, 25 January 2023 at 16:23:51 UTC, FeepingCreature 
> wrote:
>> Before I take on the effort of writing up and submitting a 
>> DIP, let me solicit feedback and see if anyone can see a 
>> reason why this idea is dumb and doesn't work.
>> [...]
>
> Sometimes I'm thinking about `rvalue` as a new storage class. 
> The problem with that is that rvalues data would be _logical_ 
> rvalues. Structures or static arrays cannot generally be 
> _physical_ rvalues, that does not work, allocas are required.
>
> But I think it's pretty clear for you already, right ?

Yeah you need to pass it as a pointer for methods and such, but I 
want to even go so far as to say that methods on an rvalue struct 
should see `this` as rvalue. (Except constructors, I guess?)


More information about the Digitalmars-d mailing list