maths: add namespaced wrappers

This commit is contained in:
Danny Robson 2015-10-06 15:21:48 +11:00
parent e12edc6c0a
commit a342654ae1

View File

@ -40,17 +40,26 @@ namespace util {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// exponentials // exponentials
template <typename T> namespace util {
constexpr T template <typename T>
pow2 [[gnu::pure]] (T value) constexpr T
pow2 [[gnu::pure]] (T value)
{ return value * value; } { return value * value; }
}
template <typename T> constexpr T pow2 [[gnu::pure]] (T value) { return util::pow2 (value); }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <typename T> template <typename T>
constexpr T constexpr T
pow [[gnu::pure]] (T x, unsigned y); pow [[gnu::pure]] (T x, unsigned y);
namespace util {
template <typename T>
constexpr T pow (T x, unsigned y) { return ::pow (x, y); }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
template <typename T> template <typename T>