Move Constructor Syntax

Lance Bachmeier no at spam.net
Sun Oct 6 18:20:04 UTC 2024


On Sunday, 6 October 2024 at 04:04:28 UTC, Walter Bright wrote:

> Something like one of:
> ```
> 1. =this(S)
> 2. this(=S)
> 3. <-this(S)
> ```
> ?
>
> It may take a bit of getting used to. I kinda prefer (1) as it 
> is sorta like `~this()`.

I'm tempted to propose Rust-style syntax using the UTF delivery 
truck emoji: 🚚this(S). Since that seems problematic, what's wrong 
with a clear and simple approach like

```
this(move S)
```

Any of the three you've proposed would add considerable overhead 
to someone learning the language. I'm not a fan of even more 
syntax.


More information about the Digitalmars-d mailing list