summaryrefslogtreecommitdiffhomepage
path: root/Private/NewKit/Array.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'Private/NewKit/Array.hpp')
-rw-r--r--Private/NewKit/Array.hpp91
1 files changed, 45 insertions, 46 deletions
diff --git a/Private/NewKit/Array.hpp b/Private/NewKit/Array.hpp
index 68ca9bfc..1799e025 100644
--- a/Private/NewKit/Array.hpp
+++ b/Private/NewKit/Array.hpp
@@ -11,60 +11,59 @@
namespace NewOS
{
-template <typename T, Size N>
-class Array final
-{
-public:
- explicit Array() = default;
- ~Array() = default;
-
- Array &operator=(const Array &) = default;
- Array(const Array &) = default;
+ template <typename T, Size N>
+ class Array final
+ {
+ public:
+ explicit Array() = default;
+ ~Array() = default;
- ErrorOr<T> operator[](Size At)
- {
- if (At > N)
- return {};
+ Array& operator=(const Array&) = default;
+ Array(const Array&) = default;
- kcout << "Returning element\r";
- return ErrorOr<T>(fArray[At]);
- }
+ ErrorOr<T> operator[](Size At)
+ {
+ if (At > N)
+ return {};
- Boolean Empty() const
- {
- for (auto Val : fArray)
- {
- if (Val)
- return false;
- }
+ kcout << "Returning element\r";
+ return ErrorOr<T>(fArray[At]);
+ }
- return true;
- }
+ Boolean Empty() const
+ {
+ for (auto Val : fArray)
+ {
+ if (Val)
+ return false;
+ }
- SizeT Count() const
- {
- SizeT cntElems = 0UL;
- for (auto Val : fArray)
- {
- if (Val)
- ++cntElems;
- }
+ return true;
+ }
- return cntElems;
- }
+ SizeT Count() const
+ {
+ SizeT cntElems = 0UL;
+ for (auto Val : fArray)
+ {
+ if (Val)
+ ++cntElems;
+ }
- const T *CData()
- {
- return fArray;
- }
+ return cntElems;
+ }
- operator bool()
- {
- return !Empty();
- }
+ const T* CData()
+ {
+ return fArray;
+ }
-private:
- T fArray[N];
+ operator bool()
+ {
+ return !Empty();
+ }
-};
+ private:
+ T fArray[N];
+ };
} // namespace NewOS