Move Constructor Syntax
Paul Backus
snarwin at gmail.com
Wed Oct 9 01:49:40 UTC 2024
On Wednesday, 9 October 2024 at 00:46:08 UTC, zjh wrote:
> On Tuesday, 8 October 2024 at 17:57:55 UTC, Anonymous wrote:
>
>
> Why not:
>
> ```d
> struct S {
> ~this(...)
> this(...) // existing variants
> _copy (...) // copy constructor
> _move (...) // move constructor
> _blit (...) // postblit constructor
> _future (...) // unknown now
> copy (...) // normal method
> }
> ```
D currently has a rule that constructors are always named `this`.
It would be nice if we could avoid breaking that rule, since it
would make the language more consistent and easier to learn.
More information about the Digitalmars-d
mailing list