diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-29 10:51:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-29 10:51:53 +0200 |
| commit | 5c0bb7ee7b1b0fee02cc179fb21f4c57a61d6c2d (patch) | |
| tree | cb17577bcdc9714c97a84ce417a075117097f146 /dev/kernel/NewKit/Array.h | |
| parent | d608230b1350b064ceb01e6572519b108f6139b0 (diff) | |
| parent | 3167f59dbb401d6a79b1524537e04218baf49ee3 (diff) | |
Merge pull request #32 from nekernel-org/dev
0.0.2e3
Diffstat (limited to 'dev/kernel/NewKit/Array.h')
| -rw-r--r-- | dev/kernel/NewKit/Array.h | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/dev/kernel/NewKit/Array.h b/dev/kernel/NewKit/Array.h deleted file mode 100644 index af73d002..00000000 --- a/dev/kernel/NewKit/Array.h +++ /dev/null @@ -1,46 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. - -------------------------------------------- */ - -#pragma once - -#include <KernelKit/DebugOutput.h> -#include <NewKit/Defines.h> -#include <NewKit/ErrorOr.h> - -namespace Kernel { -template <typename T, SizeT N> -class Array final { - public: - explicit Array() = default; - ~Array() = default; - - Array& operator=(const Array&) = default; - Array(const Array&) = default; - - T& operator[](SizeT at) { - MUST_PASS(at < this->Count()); - return fArray[at]; - } - - Boolean Empty() { return this->Count() > 0; } - - SizeT Capacity() { return N; } - - SizeT Count() { return N; } - - const T* CData() { return fArray; } - - operator bool() { return !Empty(); } - - private: - T fArray[N]; -}; - -template <typename ValueType> -auto make_list(ValueType val) { - return Array<ValueType, ARRAY_SIZE(val)>{val}; -} -} // namespace Kernel |
