constancy and template parameters in D2.009+

Janice Caron caron800 at googlemail.com
Thu Dec 13 11:37:12 PST 2007


On 12/13/07, Christopher Wright <dhasenan at gmail.com> wrote:
> Of course, if you say that the constness of parameters should always be
> preserved, you'd get:
>
> template RemoveHeadConst(T) {
>     static if (is (T : const(U), U)) {
>        alias U RemoveHeadConst;
>     } else {
>        alias T RemoveHeadConst;
>     }
> }

Assuming that works, yes. It doesn't in D2.008, and I don't believe it
did in D2.007 (although you'd imagine it should).



More information about the Digitalmars-d mailing list