From bf98e25e43c3f6efe207c3dde1732d44c34ac285 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 25 Dec 2007 09:48:53 +0000 Subject: (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed. --- src/core/math_func.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/math_func.hpp') diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index c05e7ffeb..e20dc6065 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -211,4 +211,16 @@ template static inline bool IsInsideMM(const T x, const uint min, co return (uint)(x - min) < (max - min); } +/** + * Type safe swap operation + * @param a variable to swap with b + * @param b variable to swap with a + */ +template void Swap(T& a, T& b) +{ + T t = a; + a = b; + b = t; +} + #endif /* MATH_FUNC_HPP */ -- cgit v1.2.3-54-g00ecf