2 Comments

What is the purpose of passing std::move(iface) to function taking by value?

void user(SomeInterface data) {

Expand full comment
author

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.

Expand full comment