{\r
impl_ = new implementation();\r
}\r
-layer::layer(layer&& other) : impl_(std::move(other.impl_)){other.impl_ = nullptr;}\r
+layer::layer(layer&& other) \r
+{\r
+ impl_ = other.impl_.compare_and_swap(nullptr, other.impl_);\r
+}\r
layer::~layer()\r
{\r
delete impl_.fetch_and_store(nullptr);\r
}\r
layer& layer::operator=(layer&& other)\r
{\r
- impl_ = std::move(other.impl_); \r
- other.impl_ = nullptr;\r
+ impl_ = other.impl_.compare_and_swap(nullptr, other.impl_);\r
return *this;\r
}\r
void layer::swap(layer& other)\r