C++ Class Extension

前端 未结 9 1230
既然无缘
既然无缘 2020-12-11 03:22

Is there a way to add new methods to a class, without modifying original class definition (i.e. compiled .lib containing class and corresponding .h file) like C#\'s class ex

9条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 03:34

    Sure you can:

    
    template 
    class Class: public Ext { /* ... */ };
    

    That doesn't mean it's the best approach though.

提交回复
热议问题