digitalmars.D.learn - struct opAssign in spec
- Red (9/9) Dec 19 2012 Looking at the Kindle spec there appears to be an error in the
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (7/17) Dec 19 2012 Here as well:
Looking at the Kindle spec there appears to be an error in the section for structs called Assignment Overload. S* opAssign (ref const S s) { a = s.a; } gives an error: Error: cannot implicitly convert expression (this) of type S to S* S opAssign (ref const S s) { does compile.
Dec 19 2012
On 12/19/2012 09:57 PM, Red wrote:Looking at the Kindle specHere as well: http://dlang.org/struct.html#AssignOverloadthere appears to be an error in the section for structs called Assignment Overload. S* opAssign (ref const S s) { a = s.a;Of course, there is also the return statement: return this;} gives an error: Error: cannot implicitly convert expression (this) of type S to S* S opAssign (ref const S s) { does compile.You are right. The documentation is wrong. Ali
Dec 19 2012