diff --git a/cruft/util/coord/base.hpp b/cruft/util/coord/base.hpp index e3c23551..98dc1e10 100644 --- a/cruft/util/coord/base.hpp +++ b/cruft/util/coord/base.hpp @@ -75,11 +75,15 @@ namespace cruft::coord { } // element accessors - constexpr T& operator[] (size_t i)& noexcept { return this->data[i]; } - constexpr T& operator[] (int i)& noexcept { return this->data[i]; } + template + constexpr T& + operator[] (IdxT i)& noexcept + { return this->data[i]; } - constexpr const T& operator[] (size_t i) const& noexcept { return this->data[i]; } - constexpr const T& operator[] (int i) const& noexcept { return this->data[i]; } + template + constexpr const T& + operator[] (IdxT i) const& noexcept + { return this->data[i]; } auto cbegin (void) const { return std::cbegin (this->data); } auto cend (void) const { return std::cend (this->data); }