Is the pass-by-value-and-then-move construct a bad idiom?
Expensive-to-move types are rare in modern C++ usage. If you are concerned about the cost of the move, write both overloads: void set_a(const A& a) { _a = a; } void set_a(A&& a) { _a = std::move(a); } or a perfect-forwarding setter: template <typename T> void set_a(T&& a) { _a = std::forward<T>(a); } that will … Read more