D2 cast away const

Janice Caron caron800 at googlemail.com
Mon Nov 5 12:11:53 PST 2007


On 11/5/07, Frank Benoit <keinfarbton at googlemail.com> wrote:
> Is there a way to make a generic T const free?

I think this works

template(T) { typedef T Mutable; }
template(T:const(T)[]) { typedef T[] Mutable; }

Then Mutable!(T) is the mutable equivalent of T

That's from memory, but I've had something like that working.



More information about the Digitalmars-d mailing list