0

私は効果的な現代のcppでpimplを学びます.いくつかの検索を行った後、pimplイディオムのimplクラスのデストラクタ実装について誰も話していません.それは不要ですか?

//in widget.h
#include <memory>
class Widget{
public:
    Widget();
private:
    struct Impl;
    std::unique_ptr<Impl> pImpl;
};
//in widget.cpp
........
struct Widget::Impl{
  std::string name;                // Widget::Impl
  std::vector<double> data;
};


struct Widget::~Impl()   //error!!!,how can we implement it
{
};
4

2 に答える 2