Browse Source

array<>::size should return constexpr expression

This allows to size buffers at compile time (matches c++11 behavior).
Yuri D'Elia 1 year ago
parent
commit
5f2f6dde13
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Firmware/mmu2_protocol_logic.h

+ 1 - 1
Firmware/mmu2_protocol_logic.h

@@ -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];
     }