[Issue 15847] It is not an error to call opAssign on an uninitialized object

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Mar 29 07:55:02 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15847

Marc Schütz <schuetzm at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schuetzm at gmx.net
         Resolution|---                         |INVALID

--- Comment #1 from Marc Schütz <schuetzm at gmx.net> ---
Your test cannot work reliably, but...

It is not a bug that opAssign() is called here. Using void initialization
doesn't mean "please turn the first assignment into a construction". That
wouldn't work in the general case. It means "don't initialize this variable,
I'll take care of it myself".

However, what you wrote on Github - that the assignment operator for the out
parameter isn't called - is still true. I've filed it here:
https://issues.dlang.org/show_bug.cgi?id=15848

--


More information about the Digitalmars-d-bugs mailing list