CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Join Date
    Mar 2004
    Posts
    235

    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).
    01101000011001010110110001101100011011110010000001110011011001010111100001111001

  2. #17
    Join Date
    Aug 2008
    Posts
    902

    Re: Constructor to extend existing class

    Quote Originally Posted by answer View Post
    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.

  3. #18
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    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
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured