"extending" existed class
kb3ctd2 at yahoo.com
Wed Oct 18 05:49:09 PDT 2006
"novice2" <sorry at noem.ail> wrote in message
news:eh4u36$2bsc$1 at digitaldaemon.com...
> I have existed class (for example Stream in phobos), and i need add
> new method to it. In the past (if i correctly remember), i was able
> to do it by defining function, that accept instance of class as
> first argument, and then use it function like instance.function()
> Can anyone say, what i missed, or the better way to "extend"
> existed class without declare new class based on existed?
I don't think that ability has ever existed. Maybe you're confusing it with
the ability to do so with arrays?
int method(int x)
int arr = new int;
int i = method(arr);
int k = arr.method(); // equivalent to above
More information about the Digitalmars-d-learn