diff --git a/base/base.pro b/base/base.pro index 46702103dc..8c64b168be 100644 --- a/base/base.pro +++ b/base/base.pro @@ -42,6 +42,7 @@ HEADERS += \ logging.hpp \ start_mem_debug.hpp \ stop_mem_debug.hpp \ + swap.hpp \ thread.hpp \ mutex.hpp \ casts.hpp \ diff --git a/base/swap.hpp b/base/swap.hpp new file mode 100644 index 0000000000..354878a8e7 --- /dev/null +++ b/base/swap.hpp @@ -0,0 +1,11 @@ +#pragma once + +#include "../std/algorithm.hpp" + +// Calls swap() function using argument dependant lookup. +// Do NOT override this function, but override swap() function instead! +template inline void Swap(T & a, T & b) +{ + using std::swap; + swap(a, b); +}