AK: Add some missing "inline" keywords in StdLibExtras.h

This commit is contained in:
Andreas Kling 2020-01-19 10:28:58 +01:00
parent 87583aea9c
commit 604c5cb98e
Notes: sideshowbarker 2024-07-19 09:57:47 +09:00

View file

@ -99,7 +99,7 @@ inline constexpr T ceil_div(T a, U b)
# pragma clang diagnostic ignored "-Wconsumed" # pragma clang diagnostic ignored "-Wconsumed"
#endif #endif
template<typename T> template<typename T>
T&& move(T& arg) inline T&& move(T& arg)
{ {
return static_cast<T&&>(arg); return static_cast<T&&>(arg);
} }
@ -113,13 +113,13 @@ struct Identity {
}; };
template<class T> template<class T>
constexpr T&& forward(typename Identity<T>::Type& param) inline constexpr T&& forward(typename Identity<T>::Type& param)
{ {
return static_cast<T&&>(param); return static_cast<T&&>(param);
} }
template<typename T, typename U> template<typename T, typename U>
T exchange(T& a, U&& b) inline T exchange(T& a, U&& b)
{ {
T tmp = move(a); T tmp = move(a);
a = move(b); a = move(b);
@ -127,7 +127,7 @@ T exchange(T& a, U&& b)
} }
template<typename T, typename U> template<typename T, typename U>
void swap(T& a, U& b) inline void swap(T& a, U& b)
{ {
U tmp = move((U&)a); U tmp = move((U&)a);
a = (T &&) move(b); a = (T &&) move(b);