switched to std::swap()