24 May
2010
24 May
'10
9:18 a.m.
Ion GaztaƱaga wrote:
[snip]
movable sm_rvalue() { movable m; return move(m); }
int main() { movable m, m2(move(m)); m = move(m2); //MSVC 7.1 //error C2679: binary '=' : no operator found which //takes a right-hand operand of type 'movable' (or //there is no acceptable conversion) //GCC //error: no matching function for call to 'movable::movable(movable)' //note: candidates are: movable::movable(rv_ref<movable>) //note: movable::movable(movable&) m = sm_rvalue(); return 0; }
You can solve it by applying move() as you did in sm_rvalue().