diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-02-11 08:51:02 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-02-11 08:51:02 +0100 |
| commit | f511ab3c1e840e1568dec67c4988f42e67d527b7 (patch) | |
| tree | 7ee9decdcc95c43d41d6d6e289e8bc4cc116888f /dev/Kernel/NewKit/ArrayList.h | |
| parent | 5a221a0ba51b55e671efac8f8708a4ab28414816 (diff) | |
ADD: LibCF
Diffstat (limited to 'dev/Kernel/NewKit/ArrayList.h')
| -rw-r--r-- | dev/Kernel/NewKit/ArrayList.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/dev/Kernel/NewKit/ArrayList.h b/dev/Kernel/NewKit/ArrayList.h index 88d67daa..6d799ad5 100644 --- a/dev/Kernel/NewKit/ArrayList.h +++ b/dev/Kernel/NewKit/ArrayList.h @@ -14,7 +14,7 @@ namespace Kernel class ArrayList final { public: - explicit ArrayList(T* list) + explicit ArrayList(T* list, SizeT length) : fList(reinterpret_cast<T>(list)) { } @@ -36,6 +36,7 @@ namespace Kernel T& operator[](int index) const { + MUST_PASS(index < this->Count()); return fList[index]; } @@ -44,10 +45,14 @@ namespace Kernel return fList; } - private: - T* fList; + SizeT Count() + { + return fLen; + } - friend class InitHelpers; + private: + T* fList{nullptr}; + SizeT fLen{0}; }; template <typename ValueType> |
