I've got a class with an atomic member variable:
struct Foo
{
std::atomic<bool> bar;
/* ... lots of other stuff, not relevant here ... */
Foo()
: bar( false )
{}
/* Trivial implementation fails in gcc 4.7 with:
* error: use of deleted function ‘std::atomic<bool>::atomic(const td::atomic<bool>&)’
*/
Foo( Foo&& other )
: bar( other.bar )
{}
};
Foo f;
Foo f2(std::move(f)); // use the move
How should be move constructor look like?
Gcc 4.7 doesn't like any of my attempts (like adding std::move()
around the other.bar
) and the net is surprisingly quiet here...