summaryrefslogtreecommitdiff
path: root/asl/utility.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'asl/utility.hpp')
-rw-r--r--asl/utility.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/asl/utility.hpp b/asl/utility.hpp
index 2877447..69838e5 100644
--- a/asl/utility.hpp
+++ b/asl/utility.hpp
@@ -11,6 +11,14 @@
namespace asl
{
+template<moveable T>
+constexpr void swap(T& a, T& b)
+{
+ T tmp{ASL_MOVE(a)};
+ a = ASL_MOVE(b);
+ b = ASL_MOVE(tmp);
+}
+
template<typename T, typename U>
T exchange(T& obj, U&& new_value)
{