http://d.puremagic.com/issues/show_bug.cgi?id=5889



--- Comment #10 from Kenji Hara <k.hara...@gmail.com> 2011-06-30 04:37:33 PDT 
---
OK. Here's another advantage of that.

----
struct S1{ int n; }
struct S2{ this(int n){} }
struct S3{ int n; void opAssign(S3 rhs){} }

void main()
{
    S1(0) = S1(0);  // Line 7
    S2(0) = S2(0);  // Line 8
    S3(0) = S3(0);  // Line 9 
}
----

Line 7 and 8 are no effect codes. We can reject them by making struct literal
as rvalue.
Line 9 is an exception. S3.opAssign can have effect, so it is legal.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to