maths: add namespaced wrappers
This commit is contained in:
parent
e12edc6c0a
commit
a342654ae1
17
maths.hpp
17
maths.hpp
@ -40,17 +40,26 @@ namespace util {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// exponentials
|
||||
|
||||
template <typename T>
|
||||
constexpr T
|
||||
pow2 [[gnu::pure]] (T value)
|
||||
{ return value * value; }
|
||||
namespace util {
|
||||
template <typename T>
|
||||
constexpr T
|
||||
pow2 [[gnu::pure]] (T value)
|
||||
{ return value * value; }
|
||||
}
|
||||
|
||||
template <typename T> constexpr T pow2 [[gnu::pure]] (T value) { return util::pow2 (value); }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
constexpr T
|
||||
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>
|
||||
|
Loading…
Reference in New Issue
Block a user