[Issue 3607] Problems with struct opEquals and const

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 1 03:13:41 PST 2010


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


Don <clugdbug at yahoo.com.au> 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 <clugdbug at yahoo.com.au> 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: -------


More information about the Digitalmars-d-bugs mailing list