Closed danielkrupinski closed 3 years ago
Remember that this is using the pImpl idiom. The private class Impl
is completely opaque to client code, so the compiler can't create a default move ctor or move operator in the client code. The only place that has that information is inside the implementation .cpp.
I suspect this code builds find in the library, but have you tried consuming it from just the public header? The test suite can be found here.
You're right, I missed that. The tests don't check movability of the objects, therefore they failed to compile only because of destructor using an incomplete type. Anyway, those special members seem to be fine being defaulted in .cpp, so I will open another pull request implementing that.
Member
std::unique_ptr
already takes care of resource management. https://en.cppreference.com/w/cpp/language/rule_of_three#Rule_of_zero