digitalmars.D.learn - getting mutable type from T
- Lutger (2/2) Mar 24 2009 How can I get the mutable type from any type T in a generic function or
- Jarrett Billingsley (2/4) Mar 24 2009 std.traits.Mutable!(T).
- Lutger (8/9) Mar 24 2009 Ah thanks! Too obvious.
How can I get the mutable type from any type T in a generic function or template, assuming T is const or immutable?
Mar 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).
Mar 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;
Mar 24 2009