https://d.puremagic.com/issues/show_bug.cgi?id=5747
Max Samukha <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #6 from Max Samukha <[email protected]> 2013-12-11 09:16:24 PST --- (In reply to comment #4) > { > return this; //This fails > return cast(T) this; //This overflows > } That's expected. It is easy to break the recursion: struct S { int* p; //prevent implicit cast T opCast(T:bool)() pure const { return false; } T opCast(T)() const if (is(Unqual!T == S)) { static if (is(T == const)) return this; else return cast(T)this; } } I think the fix to issue 11722 has introduced an unnecessary limitation (provided other annoyances are removed, such as opCast not being called if types match exactly). -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
