mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00:00
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.
This commit is contained in:
parent
a40abd6ce3
commit
d1fe6a0b53
13 changed files with 43 additions and 43 deletions
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue