Closed JVApen closed 1 year ago
Code on Compiler Explorer:
#include <boost/container/small_vector.hpp> #include <memory> struct C { C(int); ~C() = default; C(const C &) = delete; C(C &&) noexcept = default; C &operator=(const C &)= delete; C &operator=(C &&)= delete; }; using V = boost::container::small_vector<C, 1>; auto f(V &&v) { return std::make_shared<V>(std::move(v)); }
Error:
error: overload resolution selected deleted operator '=' *r = *f; ~~ ^ ~~
Within a move constructor, I don't expect operator= to be used, as it should only be calling the move constructor of the class.
operator=
Many thanks for the report!
Code on Compiler Explorer:
Error:
Within a move constructor, I don't expect
operator=
to be used, as it should only be calling the move constructor of the class.