summaryrefslogtreecommitdiff
path: root/AK/StdLibExtras.h
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@colorado.edu>2020-10-20 10:08:13 -0600
committerGitHub <noreply@github.com>2020-10-20 18:08:13 +0200
commitd1fe6a0b535169aed22d08463bb92b9ae62b5d15 (patch)
tree06841235a49af66d66d46033a44c30237cedd39d /AK/StdLibExtras.h
parenta40abd6ce3a032b1baf52c3573ff02ad658c6e91 (diff)
downloadserenity-d1fe6a0b535169aed22d08463bb92b9ae62b5d15.zip
Everywhere: Redundant inline specifier on constexpr functions (#3807)
Problem: - `constexpr` functions are decorated with the `inline` specifier keyword. This is redundant because `constexpr` functions are implicitly `inline`. - [dcl.constexpr], ยง7.1.5/2 in the C++11 standard): "constexpr functions and constexpr constructors are implicitly inline (7.1.2)". Solution: - Remove the redundant `inline` keyword.
Diffstat (limited to 'AK/StdLibExtras.h')
-rw-r--r--AK/StdLibExtras.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h
index 02032ea1e2..17bd4acfea 100644
--- a/AK/StdLibExtras.h
+++ b/AK/StdLibExtras.h
@@ -28,7 +28,7 @@
#define UNUSED_PARAM(x) (void)x
-inline constexpr unsigned round_up_to_power_of_two(unsigned value, unsigned power_of_two)
+constexpr unsigned round_up_to_power_of_two(unsigned value, unsigned power_of_two)
{
return ((value - 1) & ~(power_of_two - 1)) + power_of_two;
}
@@ -45,19 +45,19 @@ constexpr SizeType array_size(T (&)[N])
}
template<typename T>
-inline constexpr T min(const T& a, const T& b)
+constexpr T min(const T& a, const T& b)
{
return b < a ? b : a;
}
template<typename T>
-inline constexpr T max(const T& a, const T& b)
+constexpr T max(const T& a, const T& b)
{
return a < b ? b : a;
}
template<typename T>
-inline constexpr T clamp(const T& value, const T& min, const T& max)
+constexpr T clamp(const T& value, const T& min, const T& max)
{
ASSERT(max >= min);
if (value > max)
@@ -68,7 +68,7 @@ inline constexpr T clamp(const T& value, const T& min, const T& max)
}
template<typename T, typename U>
-inline constexpr T ceil_div(T a, U b)
+constexpr T ceil_div(T a, U b)
{
static_assert(sizeof(T) == sizeof(U));
T result = a / b;
@@ -312,13 +312,13 @@ struct RemoveReference<T&&> {
};
template<class T>
-inline constexpr T&& forward(typename RemoveReference<T>::Type& param)
+constexpr T&& forward(typename RemoveReference<T>::Type& param)
{
return static_cast<T&&>(param);
}
template<class T>
-inline constexpr T&& forward(typename RemoveReference<T>::Type&& param) noexcept
+constexpr T&& forward(typename RemoveReference<T>::Type&& param) noexcept
{
static_assert(!IsLvalueReference<T>::value, "Can't forward an rvalue as an lvalue.");
return static_cast<T&&>(param);
@@ -505,7 +505,7 @@ template<typename... Ts>
using Void = void;
template<typename... _Ignored>
-inline constexpr auto DependentFalse = false;
+constexpr auto DependentFalse = false;
}