https://d.puremagic.com/issues/show_bug.cgi?id=12211
--- Comment #2 from Kenji Hara <[email protected]> 2014-02-20 21:33:01 PST --- Note that, "an assignment expression should make an lvalue" will be consistent with the behavior of the implicitly generated opAssign methods for user defined structs. import core.stdc.stdio; struct S { this(this) { printf("postblit\n"); } } void main() { S a; S b; pragma(msg, typeof(S.opAssign)); // Prints: pure nothrow ref @safe S(S p) // So, the implicitly generated opAssign returns the reference of the // assigned value. b = (a = S()); // is translated to: b(a.opAssign(S())) // and the lvalue a.opAssign(S()) makes a copy. // Therefore, in runtime this line will print one "postblit". } -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
