Move Constructor Syntax

Zoadian no at no.no
Thu Oct 10 09:33:21 UTC 2024


On Thursday, 10 October 2024 at 07:09:34 UTC, Walter Bright wrote:
>> this(ref S) // copy constructor
>> this(this)  // postblit
>> this(S)     // move constructor
>> ~this()     // destructor

the fact that you have to add comments shows how bad the syntax 
actually is.
imaging having them readable like this instead so one doesn't 
have to look up the language documentation to figure out what's 
going on:
```
constructor()
copy_constructor()
blit_constructor()
move_constructor()
destructor()

```
or
```
this()
this_copy()
this_blit()
this_move()
~this()

```


also makes them grepable, which is much harder than saerching for 
```this(ref S)```



More information about the Digitalmars-d mailing list