Move Constructor Syntax

Anonymous nomail at nomail.no
Tue Oct 8 17:57:55 UTC 2024


On Tuesday, 8 October 2024 at 07:30:08 UTC, ryuukk_ wrote:
> On Sunday, 6 October 2024 at 19:00:09 UTC, Anonymous wrote:
>> this move(...)
>> this copy(...)
>> this(...)
>> ~this(...)

> ...
> copy / move are very common keywords, if they become reserved, 
> i'll riot
> ...

     Copy and move should not be reserved, they specify 'this'. 
I'm assuming it's possible to add anything between this and (), 
without reserving anything new or be in conflict with anything 
existing.
     '''
     struct S {
       ~this(...)
       this(...) // existing variants
       this.copy (...) // copy constructor
       this.move (...) // move constructor
       this.blit (...) // postblit constructor
       this.future (...) // unknown now
       copy (...)   // normal method
       move (...)   // normal method
       blit (...)   // normal method
       future (...) // normal method
     }
     ...
     S s;
     s(...); // existing
     s.this.copy(...);
     s.this.move(...);
     s.this.blit(...);
     s.copy(...);
     s.move(...);
     s.blit(...);
     s.future(...);
     '''



More information about the Digitalmars-d mailing list