[Issue 3607] Problems with struct opEquals and const
https://issues.dlang.org/show_bug.cgi?id=3607 Andrei Alexandrescu changed: What|Removed |Added Version|2.036 |D2 --
[Issue 3607] Problems with struct opEquals and const
http://d.puremagic.com/issues/show_bug.cgi?id=3607 yebblies changed: What|Removed |Added Status|NEW |RESOLVED CC||yebbl...@gmail.com Resolution||DUPLICATE --- Comment #4 from yebblies 2011-06-12 22:44:02 PDT --- *** This issue has been marked as a duplicate of issue 3659 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3607] Problems with struct opEquals and const
http://d.puremagic.com/issues/show_bug.cgi?id=3607 --- Comment #3 from Richard Webb 2010-12-01 06:45:44 PST --- Shouldn't the spec say 'bool opEquals' instead of 'int opEquals' ? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3607] Problems with struct opEquals and const
http://d.puremagic.com/issues/show_bug.cgi?id=3607 Don changed: What|Removed |Added Summary|Regression(2.037) Problems |Problems with struct |with struct opEquals and|opEquals and const |const | Severity|regression |enhancement --- Comment #2 from Don 2010-12-01 03:12:08 PST --- The error message is correct, and the code compiles if you change the signature to ref const Foo. The spec clearly states: "If structs declare an opEquals member function, it should follow the following form: struct S { int opEquals(ref const S s) { ... } }" A key point in the forum discussion, which was missing from the bug report was this comment: > I think it should be allowed to have a signature like this: > bool opEquals(T other) const > inside T as long as T can be implicitly cast from const to mutable. Changing to an enhancement request. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---