On 07/19/2010 06:51 PM, Jesse Phillips wrote:
What about:

struct String {
        string items;
        alias items this;
}

And add the needed functions you wish to have in string and it will still work 
in existing functions that operate on immutable(char)[]

Fortunately you can essentially achieve the above by simply writing free functions that take a string or a ref string as their first argument. Then you can use str.foo(args) as an alternative for foo(str, args).

Andrei

Reply via email to