id summary reporter owner description type status milestone component version severity resolution keywords cc 12194 Copy assignment on moveable and copyable classes uses wrong type a.grund@… Ion Gaztañaga "A patch introduced a breaking change to classes that are copyable and movable: https://github.com/boostorg/move/commit/4f9c2b62fbdcf5995ecf50a2ecf2494048a6696d#diff-6a11d48d06dd33c1193ffb3d794787fbR252 The macro was changed so the {{{TYPE& operator=(TYPE &t)}}} calls the assignement operator with a type {{{ const TYPE& }}} instead of {{{ const ::boost::rv & }}} This change is not described and seems to be a mistake that was not caught in the review process. As the macro {{{ BOOST_COPY_ASSIGN_REF }}} still expands to the original rv-type a wrong operator might get called. A minimum example: {{{ #include #include class Foo{ BOOST_COPYABLE_AND_MOVABLE(Foo) public: int i; explicit Foo(int val): i(val){} Foo(BOOST_RV_REF(Foo) obj): i(obj.i) {} Foo& operator=(BOOST_RV_REF(Foo) rhs){ i = rhs.i; return *this; } Foo& operator=(BOOST_COPY_ASSIGN_REF(Foo) rhs){ i = rhs.i; return *this; } template Foo& operator=(const OTHER& rhs){ i = rhs.j; return *this; } }; struct Bar{ int j; explicit Bar(int val): j(val){} }; int main(){ Foo foo1(1); Foo foo2(2); Bar bar(3); assert(foo1.i == 1); assert(foo2.i == 2); assert(bar.j == 3); foo2 = foo1; assert(foo1.i == 1); assert(foo2.i == 1); foo1 = bar; assert(foo1.i == 3); return 0; } }}} This compiles and works fine in boost <=1.58 but fails in >=1.59 as the template version is called." Bugs closed Boost 1.61.0 move Boost 1.59.0 Regression fixed