Boost logo

Boost Users :

Subject: Re: [Boost-users] [Review] Formal Review: Boost.Move
From: Ilya Sokolov (ilyasokol_at_[hidden])
Date: 2010-05-24 05:18:36


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().


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net