From a342654ae1efb446a0a475d5dd7b490e979a2361 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 6 Oct 2015 15:21:48 +1100 Subject: [PATCH] maths: add namespaced wrappers --- maths.hpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/maths.hpp b/maths.hpp index 250f3084..8566c660 100644 --- a/maths.hpp +++ b/maths.hpp @@ -40,17 +40,26 @@ namespace util { /////////////////////////////////////////////////////////////////////////////// // exponentials -template -constexpr T -pow2 [[gnu::pure]] (T value) - { return value * value; } +namespace util { + template + constexpr T + pow2 [[gnu::pure]] (T value) + { return value * value; } +} +template constexpr T pow2 [[gnu::pure]] (T value) { return util::pow2 (value); } //----------------------------------------------------------------------------- template constexpr T pow [[gnu::pure]] (T x, unsigned y); +namespace util { + + template + constexpr T pow (T x, unsigned y) { return ::pow (x, y); } +} + //----------------------------------------------------------------------------- template