diff options
| author | Léo Lam <leo@leolam.fr> | 2022-07-01 17:01:27 +0200 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2022-07-01 17:01:40 +0200 |
| commit | a58231b44a9dd32120b1d0c6389b2e025eecd596 (patch) | |
| tree | c24c1a6b54760a9451f3c9160cbdaa67210c250c | |
| parent | 0912686d9b4a41fed203215be63f348161dc5e6e (diff) | |
IteratorUtil: Fix missing constexpr on getIndex()
| -rw-r--r-- | src/KingSystem/Utils/IteratorUtil.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/KingSystem/Utils/IteratorUtil.h b/src/KingSystem/Utils/IteratorUtil.h index aa64b5a8..32ad803b 100644 --- a/src/KingSystem/Utils/IteratorUtil.h +++ b/src/KingSystem/Utils/IteratorUtil.h @@ -65,7 +65,7 @@ public: constexpr ElementProxy(Container& container, int index) : mIndex(index), mContainer(container) {} - int getIndex() const { return mIndex; } + constexpr int getIndex() const { return mIndex; } constexpr decltype(auto) get() const { return mContainer[mIndex]; } constexpr decltype(auto) operator*() const { return get(); } constexpr auto* operator->() const { return &get(); } @@ -83,7 +83,7 @@ public: constexpr bool operator==(Iterator rhs) const { return mIndex == rhs.mIndex; } constexpr bool operator!=(Iterator rhs) const { return !operator==(rhs); } - int getIndex() const { return mIndex; } + constexpr int getIndex() const { return mIndex; } constexpr ElementProxy operator*() const { return ElementProxy(mContainer, mIndex); } constexpr Iterator& operator++() { |
