http://d.puremagic.com/issues/show_bug.cgi?id=8686
Summary: Tuple cannot define with type that has only mutable opEquals Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: zan77...@nifty.com --- Comment #0 from SHOO <zan77...@nifty.com> 2012-09-18 07:01:43 PDT --- On git head, this code doesn't work: ------------------------- import std.typecons; struct S { bool opEquals(T)(T a) { return false; } } void main(string[] args) { auto t = tuple(S.init); } ------------------------- RESULT: ------------------------- import\std\typecons.d(432): Error: template main.S.opEquals does not match any function template declaration main.d(5): Error: template main.S.opEquals cannot deduce template function from argument types !()(const(S)) ------------------------- This problem is probably caused by this commit: https://github.com/D-Programming-Language/phobos/commit/3c878f4b90670b46854fc66a09a8f68995fdb4ea This implementation forces opEquals() const on the type that it controls. Add a further condition that is to define the method if needed to constraint-if to avoid it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------