Daily bit(e) of C++ #318, Type erasure using an explicit wrapper type using the PIMPL pattern.
What is the purpose of passing std::move(iface) to function taking by value?
void user(SomeInterface data) {
Well, in this case we can't copy, since the object isn't copyable because of the std::unique_ptr. The alternative would be to pass by const-ref.
What is the purpose of passing std::move(iface) to function taking by value?
void user(SomeInterface data) {
Well, in this case we can't copy, since the object isn't copyable because of the std::unique_ptr. The alternative would be to pass by const-ref.