- 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