diff options
Diffstat (limited to 'src/kernel/NeKit')
| -rw-r--r-- | src/kernel/NeKit/Variant.h | 6 | ||||
| -rw-r--r-- | src/kernel/NeKit/Variant.inl | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/kernel/NeKit/Variant.h b/src/kernel/NeKit/Variant.h index 41c5f942..2f4ce1ff 100644 --- a/src/kernel/NeKit/Variant.h +++ b/src/kernel/NeKit/Variant.h @@ -54,9 +54,7 @@ class Variant final { RefAny Leak(); template <typename T> - T* As() { - return reinterpret_cast<T*>(fPtr); - } + T* As(); VariantKind& Kind(); @@ -66,4 +64,6 @@ class Variant final { }; } // namespace Kernel +#include "Variant.inl" + #endif diff --git a/src/kernel/NeKit/Variant.inl b/src/kernel/NeKit/Variant.inl new file mode 100644 index 00000000..bad41d72 --- /dev/null +++ b/src/kernel/NeKit/Variant.inl @@ -0,0 +1,13 @@ +// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (see LICENSE file) +// Official repository: https://github.com/nekernel-org/nekernel + +#ifndef NEKIT_VARIANT_INL +#define NEKIT_VARIANT_INL + +template <typename T> +inline T* Kernel::Variant::As() { + return reinterpret_cast<T*>(fPtr); +} + +#endif |
