Not necessary to export class with only virtual/inline functions?

后端 未结 4 1111
鱼传尺愫
鱼传尺愫 2021-01-19 02:14

In C++ on Win32:

Suppose I have a DLL with a header file that declares a class. The DLL exports some means of obtaining a pointer/reference to an instance of that c

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-19 02:36

    C++ name mangling serves as a burden to the success of writting cross-compiler modulars, simply declare the class you want to expose as an interface containing nothing but virtual functions. The layout of the class with virtual functions might be 'standardized', think of COM.

提交回复
热议问题