coord/base: allow arbitrary integral types for indexing
This commit is contained in:
parent
5718506b1d
commit
c3f79d1e69
@ -75,11 +75,15 @@ namespace cruft::coord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// element accessors
|
// element accessors
|
||||||
constexpr T& operator[] (size_t i)& noexcept { return this->data[i]; }
|
template <typename IdxT>
|
||||||
constexpr T& operator[] (int i)& noexcept { return this->data[i]; }
|
constexpr T&
|
||||||
|
operator[] (IdxT i)& noexcept
|
||||||
|
{ return this->data[i]; }
|
||||||
|
|
||||||
constexpr const T& operator[] (size_t i) const& noexcept { return this->data[i]; }
|
template <typename IdxT>
|
||||||
constexpr const T& operator[] (int i) const& noexcept { return this->data[i]; }
|
constexpr const T&
|
||||||
|
operator[] (IdxT i) const& noexcept
|
||||||
|
{ return this->data[i]; }
|
||||||
|
|
||||||
auto cbegin (void) const { return std::cbegin (this->data); }
|
auto cbegin (void) const { return std::cbegin (this->data); }
|
||||||
auto cend (void) const { return std::cend (this->data); }
|
auto cend (void) const { return std::cend (this->data); }
|
||||||
|
Loading…
Reference in New Issue
Block a user