[Issue 8522] Overloading template function with prefix const doesn't work
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Aug 8 08:51:17 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8522
--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2012-08-08 08:51:16 PDT ---
More explainable test case.
struct Point
{
bool opEquals(R)(R rhs) { return true; }
bool opEquals(R)(R rhs) const { return true; }
}
void main()
{
Point mp;
const Point cp;
assert(mp == mp);
assert(mp == cp);
assert(cp == mp); // doesn't work
assert(cp == cp); // doesn't work
}
If the left hand side of '==' is const value, const opEquals never matches.
--
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