src/generics/functions.h

changeset 1430
6ce6d3da584f
parent 1429
80e8aaabeeed
--- a/src/generics/functions.h	Tue Aug 07 20:34:32 2018 +0300
+++ b/src/generics/functions.h	Sat Sep 15 15:57:56 2018 +0300
@@ -37,13 +37,7 @@
 }
 
 template<typename T>
-T squared(T value)
-{
-	return ::pow(value, 2);
-}
-
-template<>
-constexpr int squared<int>(int value)
+auto constexpr squared(T value)
 {
 	return value * value;
 }
@@ -70,13 +64,13 @@
 template<typename T>
 constexpr int rotl10(T x)
 {
-	return (((x) << 10) | (((x) >> 22) & 0x000000ff));
+	return (x << 10) | ((x >> 22) & 0x000000ff);
 }
 
 template<typename T>
 constexpr int rotl20(T x)
 {
-	return (((x) << 20) | (((x) >> 12) & 0x000000ff));
+	return (x << 20) | ((x >> 12) & 0x000000ff);
 }
 
 //

mercurial