#ifndef CORE_ARRAY_HPP #define CORE_ARRAY_HPP #include "utils/ArrayString.hpp" namespace Core { template class Array final { static_assert(N > 0, "Array size must be positive"); T data[static_cast(N)]; public: Array() = default; Array(const T& t) { fill(t); } void fill(const T& t) { for(int i = 0; i < N; i++) { data[i] = t; } } T& operator[](int index) { return data[index]; } const T& operator[](int index) const { return data[index]; } T* begin() { return data; } T* end() { return data + N; } const T* begin() const { return data; } const T* end() const { return data + N; } constexpr int getLength() const { return N; } template check_return Error toString(String& s) const { return Core::toString(s, *this); } }; } #endif