Copy constructor hell

RazvanN razvan.nitu1305 at gmail.com
Tue May 14 12:42:15 UTC 2019


On Thursday, 9 May 2019 at 04:58:14 UTC, 9il wrote:
> 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

Thanks for the report. Please notify me of any other bugs 
regarding the copy constructor that you find. After you finish 
the transition of mir from postblit
to copy constructor maybe we can get Mike to add a blog post with 
your experience
so that others migrate to the copy constructor as well,

Thanks,
RazvanN


More information about the Digitalmars-d mailing list