summaryrefslogtreecommitdiffhomepage
path: root/dev/Boot/BootKit/Vendor/Shared/base.h
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-15 18:35:34 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-15 18:35:34 +0200
commitf3d931aa7cfaf96baef8383b59a8938779541ee7 (patch)
treefdb9fc51badb3dbd03e46ab0766a49d9522e13e2 /dev/Boot/BootKit/Vendor/Shared/base.h
parent86640816e8b1d3595365f1fcc8a2a9e61fb40ff1 (diff)
[IMP] Moved source code into dev/ folder.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/Boot/BootKit/Vendor/Shared/base.h')
-rw-r--r--dev/Boot/BootKit/Vendor/Shared/base.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/dev/Boot/BootKit/Vendor/Shared/base.h b/dev/Boot/BootKit/Vendor/Shared/base.h
new file mode 100644
index 00000000..d1c028d7
--- /dev/null
+++ b/dev/Boot/BootKit/Vendor/Shared/base.h
@@ -0,0 +1,26 @@
+#ifndef UTL_BASE_H
+#define UTL_BASE_H
+
+#include <cstdint>
+#include <cstddef>
+#include <cassert>
+
+namespace utl
+{
+
+ /**
+ * @brief Helper to get number of elements in array.
+ *
+ * @tparam T Auto-deduced element type
+ * @tparam N Auto-deduced number of elements
+ * @return Array size
+ */
+ template <class T, size_t N>
+ constexpr size_t countof(T (&)[N])
+ {
+ return N;
+ }
+
+} // namespace utl
+
+#endif \ No newline at end of file