Using shared_ptr in dll-interfaces

前端 未结 4 1484
闹比i
闹比i 2020-12-02 19:12

I have an abstract class in my dll.

class IBase {
  protected:
       virtual ~IBase() = 0;
  public:
       virtual void f() = 0;
};

I wan

4条回答
  •  心在旅途
    2020-12-02 19:42

    1. Using shared_ptr will make sure the resource releasing function will be called in the DLL.
    2. Have a look at the answers to this question.

    A way out of this problem is to create a pure C interface and a thin fully inlined C++ wrapper around it.

提交回复
热议问题