Thread overview
getting mutable type from T
Mar 24, 2009
Lutger
Mar 24, 2009
Lutger
March 24, 2009
How can I get the mutable type from any type T in a generic function or template, assuming T is const or immutable?


March 24, 2009
On Tue, Mar 24, 2009 at 6:33 AM, Lutger <lutger.blijdestijn@gmail.com> wrote:
> How can I get the mutable type from any type T in a generic function or template, assuming T is const or immutable?
>
>
>

std.traits.Mutable!(T).
March 24, 2009
Jarrett Billingsley wrote:
..
> std.traits.Mutable!(T).

Ah thanks! Too obvious.

In case somebody would like to know:

    static if (is(T U == const(U)))
	alias U Mutable;
    else static if (is(T U == immutable(U)))
	alias U Mutable;