Код: Выделить всё
struct Foo
{
std::atomic 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::atomic(const td::atomic&)’
*/
Foo( Foo&& other )
: bar( other.bar )
{}
};
Foo f;
Foo f2(std::move(f)); // use the move
Gcc 4.7 не нравится ни одна из моих попыток (например, добавление std::move() вокруг другого.bar), и сеть здесь на удивление тиха...
Подробнее здесь: https://stackoverflow.com/questions/141 ... ool-member
Мобильная версия