diff options
| author | Amlal <amlal@nekernel.org> | 2025-04-25 13:08:33 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-04-25 13:08:33 +0200 |
| commit | fb790b07aeba8e22e4190cf3e1834d11ecde6c96 (patch) | |
| tree | 4cec7d1b321307b1d5935577631dae116a658a37 /dev/kernel/NewKit/Array.h | |
| parent | 63a2d92c5dfe976175cda024ec01905d11b43738 (diff) | |
dev: better .clang-format, ran format command.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/NewKit/Array.h')
| -rw-r--r-- | dev/kernel/NewKit/Array.h | 73 |
1 files changed, 27 insertions, 46 deletions
diff --git a/dev/kernel/NewKit/Array.h b/dev/kernel/NewKit/Array.h index 1dcc6720..af73d002 100644 --- a/dev/kernel/NewKit/Array.h +++ b/dev/kernel/NewKit/Array.h @@ -1,65 +1,46 @@ /* ------------------------------------------- - Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. + Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. ------------------------------------------- */ #pragma once #include <KernelKit/DebugOutput.h> -#include <NewKit/ErrorOr.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; +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; + Array& operator=(const Array&) = default; + Array(const Array&) = default; - T& operator[](SizeT at) - { - MUST_PASS(at < this->Count()); - return fArray[at]; - } + T& operator[](SizeT at) { + MUST_PASS(at < this->Count()); + return fArray[at]; + } - Boolean Empty() - { - return this->Count() > 0; - } + Boolean Empty() { return this->Count() > 0; } - SizeT Capacity() - { - return N; - } + SizeT Capacity() { return N; } - SizeT Count() - { - return N; - } + SizeT Count() { return N; } - const T* CData() - { - return fArray; - } + const T* CData() { return fArray; } - operator bool() - { - return !Empty(); - } + operator bool() { return !Empty(); } - private: - T fArray[N]; - }; + private: + T fArray[N]; +}; - template <typename ValueType> - auto make_list(ValueType val) - { - return Array<ValueType, ARRAY_SIZE(val)>{val}; - } -} // namespace Kernel +template <typename ValueType> +auto make_list(ValueType val) { + return Array<ValueType, ARRAY_SIZE(val)>{val}; +} +} // namespace Kernel |
