AK: Add Retained<T>, like RetainPtr, but never null.

Also use some Clang attribute wizardry to get a warning for use-after-move.
This commit is contained in:
Andreas Kling 2019-02-25 12:43:52 +01:00
commit 2cfcbdc735
Notes: sideshowbarker 2024-07-19 15:38:07 +09:00
31 changed files with 214 additions and 104 deletions

View file

@ -60,11 +60,18 @@ static inline T ceil_div(T a, U b)
return result;
}
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconsumed"
#endif
template <typename T>
T&& move(T& arg)
{
return static_cast<T&&>(arg);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
template<typename T>
struct Identity {