array<>::size should return constexpr expression

This allows to size buffers at compile time (matches c++11 behavior).
This commit is contained in:
Yuri D'Elia 2022-12-08 17:50:16 +01:00 committed by DRracer
parent 2e7c237a17
commit 5f2f6dde13
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ public:
array() = default;
inline constexpr T* begin()const { return data; }
inline constexpr T* end()const { return data + N; }
constexpr uint8_t size()const { return N; }
static constexpr uint8_t size() { return N; }
inline T &operator[](uint8_t i){
return data[i];
}