Move Constructor Syntax
Walter Bright
newshound2 at digitalmars.com
Thu Oct 10 06:51:34 UTC 2024
On 10/7/2024 9:21 AM, max haughton wrote:
> Within the language today what part of a move operation actually requires a new
> form of constructor?
I desperately tried to make `this(S)` a move constructor. I could not find a way
that did not break existing code and/or require some rather horrific changes to
the complicated logic in the compiler.
I explained this earlier - the compiler cannot determine if `this(S)` is a move
constructor or not until after semantic analysis. But it needs to know it before
semantic analysis. And so the carousel of troubles spins up.
Having a distinct syntax simplifies things enormously.
More information about the Digitalmars-d
mailing list