AK: Specialise AK::is() for NNRP<T>

This is used by the Jakt runtime.
This commit is contained in:
Ali Mohammad Pur 2022-12-10 23:59:55 +03:30 committed by Ali Mohammad Pur
parent 18bc88b806
commit fc805e8f03
Notes: sideshowbarker 2024-07-17 20:22:04 +09:00

View file

@ -7,6 +7,7 @@
#pragma once #pragma once
#include <AK/Assertions.h> #include <AK/Assertions.h>
#include <AK/Forward.h>
#include <AK/Platform.h> #include <AK/Platform.h>
#include <AK/StdLibExtras.h> #include <AK/StdLibExtras.h>
@ -27,6 +28,12 @@ ALWAYS_INLINE bool is(InputType* input)
return input && is<OutputType>(*input); return input && is<OutputType>(*input);
} }
template<typename OutputType, typename InputType>
ALWAYS_INLINE bool is(NonnullRefPtr<InputType> const& input)
{
return is<OutputType>(*input);
}
template<typename OutputType, typename InputType> template<typename OutputType, typename InputType>
ALWAYS_INLINE CopyConst<InputType, OutputType>* verify_cast(InputType* input) ALWAYS_INLINE CopyConst<InputType, OutputType>* verify_cast(InputType* input)
{ {