changeset 8626 | 440dfcd14c4a |
parent 8619 | c2434269c3eb |
child 9106 | 604b69ee3879 |
--- a/src/core/math_func.hpp Tue Dec 25 01:29:54 2007 +0000 +++ b/src/core/math_func.hpp Tue Dec 25 09:48:53 2007 +0000 @@ -211,4 +211,16 @@ 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<typename T> void Swap(T& a, T& b) +{ + T t = a; + a = b; + b = t; +} + #endif /* MATH_FUNC_HPP */