Re: Constructor to extend existing class
there needs to be a way to add functions to a class without deriving or inheriting. Mostly because I like seeing
integrated = image.integrate();
more than
integrated = integrate(image);
mostly because in English the subject(object=image) is usually first then the verb(action=integrate).
Re: Constructor to extend existing class
Quote:
Originally Posted by
answer
there needs to be a way to add functions to a class without deriving or inheriting. Mostly because I like seeing
integrated = image.integrate();
more than
integrated = integrate(image);
mostly because in English the subject(object=image) is usually first then the verb(action=integrate).
You could switch to C# if it's that important to you. C# has extension classes.
Re: Constructor to extend existing class
Quote:
Originally Posted by answer
there needs to be a way to add functions to a class without deriving or inheriting. Mostly because I like seeing
integrated = image.integrate();
more than
integrated = integrate(image);
mostly because in English the subject(object=image) is usually first then the verb(action=integrate).
Since you are already aware that an interface can be extended by writing non-member non-friend functions, it is not a need, it is a want ;)