diff --git a/include/rexy/cx/utility.hpp b/include/rexy/cx/utility.hpp index 4074450..8deb581 100644 --- a/include/rexy/cx/utility.hpp +++ b/include/rexy/cx/utility.hpp @@ -27,11 +27,12 @@ namespace rexy::cx{ namespace{ template constexpr void swap(T& l, T& r) - noexcept(std::is_nothrow_copy_assignable::value) + noexcept(std::is_nothrow_move_assignable::value && + std::is_nothrow_move_constructible::value) { - T tmp = l; - l = r; - r = tmp; + T tmp = std::move(l); + l = std::move(r); + r = std::move(tmp); } template constexpr T exchange(T& l, U&& r)