diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index f233ab4219..3219f896d7 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -293,3 +293,4 @@ using AK::max; using AK::min; using AK::move; using AK::swap; +using AK::RemoveConst; diff --git a/LibCore/CObject.h b/LibCore/CObject.h index fda00cd976..3e73d44fda 100644 --- a/LibCore/CObject.h +++ b/LibCore/CObject.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -63,19 +64,22 @@ private: }; template -inline bool is(const CObject&) { return true; } +inline bool is(const CObject&) { return false; } + +template<> +inline bool is(const CObject&) { return true; } template inline T& to(CObject& object) { - ASSERT(is(object)); + ASSERT(is::Type>(object)); return static_cast(object); } template inline const T& to(const CObject& object) { - ASSERT(is(object)); + ASSERT(is::Type>(object)); return static_cast(object); }