Move Constructor Syntax

Walter Bright newshound2 at digitalmars.com
Fri Oct 11 06:25:02 UTC 2024


On 10/10/2024 4:35 PM, Danni Coy wrote:
> As a new user 
> of the language the only way you can figure out what it does is to read the 
> documentation and memorise.

That's true with the entirety of programming languages. Though you don't really 
need to memorize - using it a few times will do the trick.

> That's something you want to avoid when creating new 
> syntax if at all possible.

D uses ~ for string concatenation. Like a duck to water!

In any case, selection of syntax has many axes of constraints. Picking the best 
one is always a collection of compromises.

For example, every feature on your car is a collection of compromises. Even the 
"safety is our top priority" is inevitably false.

Even
```
a = b
```
is not intuitive. Assignment is quite different from algebraic equality. There's 
nothing inherent there about a copy vs a move, either.

It's all just what we learn and get used to.



More information about the Digitalmars-d mailing list