summaryrefslogtreecommitdiffhomepage
path: root/src/kernel/NeKit/Domain.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/NeKit/Domain.h')
-rw-r--r--src/kernel/NeKit/Domain.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/kernel/NeKit/Domain.h b/src/kernel/NeKit/Domain.h
new file mode 100644
index 00000000..cda63ee9
--- /dev/null
+++ b/src/kernel/NeKit/Domain.h
@@ -0,0 +1,37 @@
+/* ========================================
+
+ Copyright (C) 2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
+
+======================================== */
+
+#ifndef __NE_KIT_DOMAIN_H__
+#define __NE_KIT_DOMAIN_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;
+};
+
+using NullDomain = IsDefined<nullPtr>;
+
+template <class Type>
+using Domain = IsDefined<Type>;
+
+template <class Type>
+concept IsAcceptable = requires() {
+ { IsDefined<Type>::kValue };
+};
+} // namespace Kernel
+
+#endif // !__NE_KIT_DOMAIN_H__ \ No newline at end of file