Move Constructor Syntax
H. S. Teoh
hsteoh at qfbox.info
Sun Oct 6 04:14:16 UTC 2024
On Sat, Oct 05, 2024 at 09:04:28PM -0700, Walter Bright via Digitalmars-d wrote:
[...]
> ```
> 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()`.
[...]
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.
T
--
Маленькие детки - маленькие бедки.
More information about the Digitalmars-d
mailing list