https://issues.dlang.org/show_bug.cgi?id=5747
Basile-z <b2.t...@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED CC| |b2.t...@gmx.com Resolution|--- |WORKSFORME --- Comment #11 from Basile-z <b2.t...@gmx.com> --- This issue is quite old and i don't see the limitation you talked about: --- struct S { int* p; T opCast(T)() const { static if (is(T == S)) return cast() this; static if (is(T == const(S))) return cast(const) this; } } void main() { const (S) s; auto b = cast(S)(s); auto c = cast(const)(b); auto d = cast(const(S))(b); } --- Maybe cast() didn't exist at this time ? --