eating inout dogfood
kenji hara
k.hara.pg at gmail.com
Fri Oct 14 15:13:29 PDT 2011
2011/10/15 Steven Schveighoffer <schveiguy at yahoo.com>:
> I don't think the compiler will auto-convert someTemplate!(inout(V)) to e.g.
> someTemplate!(const(V)). Does that work? I know that for instance, I can't
> do this:
>
> struct S(T)
> {
> T * x;
> }
>
> S!(int) ptr;
> S!(const(int)) cptr = ptr;
>
> So I wouldn't expect the compiler to do the above translation either...
IMO, for the purpose we need covariant/contravariant template type
parameter like Scala.
Kenji Hara
More information about the Digitalmars-d
mailing list