You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to dlang/dmd#20970, any types with a copy constructor should not be used in a dynamic array or associative array, which realistically means that no one who isn't using -betterC should be using copy constructors.
However, the spec currently has a warning on postblit constructors, telling programmers to use copy constructors in new code instead. This might make sense if druntime supported copy constructors properly, but it doesn't. And until it does, IMHO, we really need to be warning programmers against using copy constructors and instead be telling them to use postblit constructors. Personally, I wasted a considerable amount of time because of this issue, because I did not realize that the support for copy constructors was not complete, and I'm one of the core contributors, and without the spec being correct with regards to the current state of things, plenty of other folks are going to make the same mistake.
The text was updated successfully, but these errors were encountered:
…ors.
Until dlang/dmd#20970 is fixed, we need to be
warning against the use of copy constructors rather than warning
against the use of postblit constructors.
So, I fixed the warning and put both it and the description of what
happens when mixing postblit constructors and copy constructors together
on both the section for postblit constructors and the one for copy
constructors.
I suspect that move constructors merit a similar warning, but I'm not
sure what their current state is, so this just fixes the warning for
postblit constructors and copy constructors.
…ors.
Until dlang/dmd#20970 is fixed, we need to be
warning against the use of copy constructors rather than warning
against the use of postblit constructors.
So, I fixed the warning and put both it and the description of what
happens when mixing postblit constructors and copy constructors together
on both the section for postblit constructors and the one for copy
constructors.
I suspect that move constructors merit a similar warning, but I'm not
sure what their current state is, so this just fixes the warning for
postblit constructors and copy constructors.
Due to dlang/dmd#20970, any types with a copy constructor should not be used in a dynamic array or associative array, which realistically means that no one who isn't using
-betterC
should be using copy constructors.However, the spec currently has a warning on postblit constructors, telling programmers to use copy constructors in new code instead. This might make sense if druntime supported copy constructors properly, but it doesn't. And until it does, IMHO, we really need to be warning programmers against using copy constructors and instead be telling them to use postblit constructors. Personally, I wasted a considerable amount of time because of this issue, because I did not realize that the support for copy constructors was not complete, and I'm one of the core contributors, and without the spec being correct with regards to the current state of things, plenty of other folks are going to make the same mistake.
The text was updated successfully, but these errors were encountered: