Copy constructor hell
9il
ilyayaroshenko at gmail.com
Thu May 9 04:58:14 UTC 2019
On Wednesday, 8 May 2019 at 18:01:34 UTC, Paul Backus wrote:
> On Wednesday, 8 May 2019 at 13:19:24 UTC, RazvanN wrote:
>>
>> The problems seems to be that the default constructor takes
>> the arguments by value so a copy needs to be performed, hence
>> the copy constructor use. This is pretty nasty. I will return
>> with the details after I sort this out.
>
> Isn't the issue that the presence of a constructor disables the
> use of "struct literal" syntax [1] for construction? The
> compiler is trying to find a constructor that matches the given
> argument, but since the only constructor is the auto-generated
> copy constructor, it can't.
>
Yes, exactly. --Ilya
More information about the Digitalmars-d
mailing list