Higher level built-in strings
Rory McGuire
rmcguire at neonova.co.za
Tue Jul 20 00:54:13 PDT 2010
On Tue, 20 Jul 2010 01:51:51 +0200, Jesse Phillips
<jessekphillips+d at 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
More information about the Digitalmars-d
mailing list