On Tue, 20 Jul 2010 01:51:51 +0200, Jesse Phillips <jessekphillip...@gmail.com> 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)[]

You shouldn't need to do that:

string strstr(string haystack, string needle);

can be used as:

string s;
s.strstr("needle");

so you can add "methods" to a string or whatever just by defining functions.

-Rory

Reply via email to