summaryrefslogtreecommitdiffhomepage
path: root/Private/NewKit/ArrayList.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-05 21:10:18 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-05 21:10:18 +0200
commitf95d8bf159d10b5a9521dcaa0bc37aa0e9dfc02b (patch)
treebf8186f1a0521a64983bb0bca4f7b54883542195 /Private/NewKit/ArrayList.hpp
parent5a903c1d8f80ca8d7bc5fbea0aea710ce0133f9d (diff)
MHR-23: Add run_format.sh, kernel patches.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NewKit/ArrayList.hpp')
-rw-r--r--Private/NewKit/ArrayList.hpp89
1 files changed, 45 insertions, 44 deletions
diff --git a/Private/NewKit/ArrayList.hpp b/Private/NewKit/ArrayList.hpp
index b7ab50cf..31646472 100644
--- a/Private/NewKit/ArrayList.hpp
+++ b/Private/NewKit/ArrayList.hpp
@@ -10,48 +10,49 @@
namespace NewOS
{
- template <typename T>
- class ArrayList final
- {
- public:
- explicit ArrayList(T *list)
- : fList(reinterpret_cast<T>(list))
- {}
-
- ~ArrayList() = default;
-
- ArrayList &operator=(const ArrayList &) = default;
- ArrayList(const ArrayList &) = default;
-
- T *Data()
- {
- return fList;
- }
-
- const T *CData()
- {
- return fList;
- }
-
- T &operator[](int index) const
- {
- return fList[index];
- }
-
- operator bool()
- {
- return fList;
- }
-
- private:
- T *fList;
-
- friend class InitHelpers;
-
- };
-
- template <typename ValueType> ArrayList<ValueType> make_list(ValueType val)
- {
- return ArrayList<ValueType>{val};
- }
+ template <typename T>
+ class ArrayList final
+ {
+ public:
+ explicit ArrayList(T* list)
+ : fList(reinterpret_cast<T>(list))
+ {
+ }
+
+ ~ArrayList() = default;
+
+ ArrayList& operator=(const ArrayList&) = default;
+ ArrayList(const ArrayList&) = default;
+
+ T* Data()
+ {
+ return fList;
+ }
+
+ const T* CData()
+ {
+ return fList;
+ }
+
+ T& operator[](int index) const
+ {
+ return fList[index];
+ }
+
+ operator bool()
+ {
+ return fList;
+ }
+
+ private:
+ T* fList;
+
+ friend class InitHelpers;
+ };
+
+ template <typename ValueType>
+ ArrayList<ValueType> make_list(ValueType val)
+ {
+ return ArrayList<ValueType>{val};
+ }
} // namespace NewOS