Move Constructor Syntax

Per Nordlöw per.nordlow at gmail.com
Wed Oct 16 07:44:49 UTC 2024


On Sunday, 6 October 2024 at 04:14:16 UTC, H. S. Teoh wrote:
> What about .opMove?  Since .opXxx have been unofficially 
> reserved for operator overloading, and one could argue that a 
> move ctor is a kind of operator overloading (overloading the 
> assignment operator).  I really dislike symbols that are part 
> of the ctor name, like C++'s operator@() overloads. It's just 
> needlessly complex syntax.

Yes, and if so deprecate the existing `this(...)` syntax is favor 
or

- `opCreate()` or `opNew()`
- `opCopy()`
- `opPostDestruct()`, `opPostDelete()`, etc...

for conformance. A couple of characters longer but linguistically 
clearer.


More information about the Digitalmars-d mailing list