{\r
channel_.execution().invoke([&]\r
{\r
- layers_[index].swap(layers_[other_index]);\r
+ std::swap(layers_[index], layers_[other_index]);\r
}, high_priority);\r
}\r
\r
swap_layer(index, other_index);\r
else\r
{\r
- auto func = [&]{layers_[index].swap(other.impl_->layers_[other_index]);}; \r
+ auto func = [&]\r
+ {\r
+ std::swap(layers_[index], other.impl_->layers_[other_index]);\r
+ }; \r
channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority);\r
}\r
}\r
\r
auto func = [&]\r
{\r
- auto sel_first = [](const std::pair<int, layer>& pair){return pair.first;};\r
-\r
- std::set<int> indices;\r
- auto inserter = std::inserter(indices, indices.begin());\r
-\r
- std::transform(layers_.begin(), layers_.end(), inserter, sel_first);\r
- std::transform(other.impl_->layers_.begin(), other.impl_->layers_.end(), inserter, sel_first);\r
-\r
- BOOST_FOREACH(auto index, indices)\r
- layers_[index].swap(other.impl_->layers_[index]);\r
- };\r
- \r
- channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);});\r
+ std::swap(layers_, other.impl_->layers_);\r
+ }; \r
+ channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority);\r
}\r
\r
layer_status get_status(int index)\r