diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-15 11:22:55 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-15 11:25:36 +0100 |
| commit | 6b4d761818b79a6fc17607e15d939154b4d8314f (patch) | |
| tree | 0a6188f201afebc4b5a22bae9f0744d7be7495f1 /src/kernel/NeKit/Nullable.h | |
| parent | cceb0a70efef009b87198796eb9016ffb82c7130 (diff) | |
feat: New Nullable system, and improved Vettable system.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/kernel/NeKit/Nullable.h')
| -rw-r--r-- | src/kernel/NeKit/Nullable.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/kernel/NeKit/Nullable.h b/src/kernel/NeKit/Nullable.h new file mode 100644 index 00000000..c17009fc --- /dev/null +++ b/src/kernel/NeKit/Nullable.h @@ -0,0 +1,26 @@ +#ifndef __NE_KIT_NULLABLE_H__ +#define __NE_KIT_NULLABLE_H__ + +#include <NeKit/Config.h> + +namespace Kernel { +template <class Type> +struct IsDefined final { + using ResultType = Type; + using ResultTypeRef = Type&; + + static constexpr bool kValue = true; +}; + +template <> +struct IsDefined<nullPtr> final { + static constexpr bool kValue = false; +}; + +template <class Type> +concept IsAcceptable = requires() { + { IsDefined<Type>::kValue }; +}; +} // namespace Kernel + +#endif // !__NE_KIT_NULLABLE_H__
\ No newline at end of file |
