mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
Kernel: Switch to using AK::is and AK::downcast
This commit is contained in:
parent
ce2c5b375c
commit
fe6474e692
5 changed files with 14 additions and 31 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <AK/InlineLinkedList.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <Kernel/Lock.h>
|
||||
|
||||
|
@ -84,14 +85,4 @@ private:
|
|||
VMObject(VMObject&&) = delete;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline bool is(const VMObject&) { return false; }
|
||||
|
||||
template<typename T>
|
||||
inline T& to(VMObject& object)
|
||||
{
|
||||
ASSERT(is<typename RemoveConst<T>::Type>(object));
|
||||
return static_cast<T&>(object);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue