[Issue 9732] Do not call opAssign() for the first assignment to member in the constructor
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 17 09:53:05 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9732
--- Comment #9 from monarchdodra at gmail.com 2013-03-17 09:53:04 PDT ---
(In reply to comment #7)
> (In reply to comment #3)
> > I really don't think that's a problem. If anything, the default value should
> > NOT be destroyed in the constructor. After all, it hasn't really even been
> > initialized yet.
>
> There are several corner cases when dtor gets default value. By the way, how
> you can distinguish whether object was recently initialized to its state was
> reseted?
>
> > If anything, that's exactly how "aggregate construction" works: postblit each
> > value over the current fields, but DON'T destroy the fields:
> >
> > [SNIP]
> >
> > So yeah, my conclusion is: destroyers are not a problem to this proposal.
>
> I don't how this is related to the issue.
The issue was "Blitting the rvalue on top of OuterStruct.inner would not be
right in that case." because "OuterStruct.inner has a destructor".
I'm saying its not a problem because it could be perfectly legal to consider
that "OuterStruct.inner" has not yet been initialized.
I'm further showing this is correct behavior, as it is exactly how struct
without constructors but with nested types that have destructors deal do it.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list