std::unique_ptr with an incomplete type won’t compile
Here are some examples of std::unique_ptr with incomplete types. The problem lies in destruction. If you use pimpl with unique_ptr, you need to declare a destructor: class foo { class impl; std::unique_ptr<impl> impl_; public: foo(); // You may need a def. constructor to be defined elsewhere ~foo(); // Implement (with {}, or with = default;) … Read more