Re: Getting the mutable version of a type

2012-03-02 Thread Magnus Lie Hetland
On 2012-03-02 11:23:20 +, Ali Çehreli said: On 03/02/2012 02:18 AM, Magnus Lie Hetland wrote: I'm writing a template for generating data of some possibly immutable type -- e.g., a string. What I'm wondering is, is there some way of accessing the mutable version of an immutable type? Yes,

Re: Getting the mutable version of a type

2012-03-02 Thread Ali Çehreli
On 03/02/2012 02:18 AM, Magnus Lie Hetland wrote: I'm writing a template for generating data of some possibly immutable type -- e.g., a string. What I'm wondering is, is there some way of accessing the mutable version of an immutable type? Yes, std.traits.Unqual: http://dlang.org/phobos/std_

Getting the mutable version of a type

2012-03-02 Thread Magnus Lie Hetland
I'm writing a template for generating data of some possibly immutable type -- e.g., a string. What I'm wondering is, is there some way of accessing the mutable version of an immutable type? I mean, I could do something like (for strings and related immutable arrays)... void func(T)(ref immutab