diff options
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 |
