mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Add some missing "inline" keywords in StdLibExtras.h
This commit is contained in:
parent
87583aea9c
commit
604c5cb98e
Notes:
sideshowbarker
2024-07-19 09:57:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/604c5cb98e8
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue