[Issue 15869] RVO can overwrite argument

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Apr 5 14:12:30 PDT 2016


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

--- Comment #5 from ag0aep6g at gmail.com ---
(In reply to Yuxuan Shui from comment #4)
> Looks like if clobber is not called in constructor, the return value is
> stored into a temporary variable and then copied into xx using Set.opAssign.
> 
> I'm not sure if this is correct since Set has disabled this(this).

`@disable this(this)` does not prevent moving the struct. A move is a bitwise
copy that invalidates the source, i.e. there are no destructor or postblit
calls.

--


More information about the Digitalmars-d-bugs mailing list