mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
AK: Specialise AK::is() for NNRP<T>
This is used by the Jakt runtime.
This commit is contained in:
parent
18bc88b806
commit
fc805e8f03
Notes:
sideshowbarker
2024-07-17 20:22:04 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/fc805e8f03 Pull-request: https://github.com/SerenityOS/serenity/pull/16396 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue