Merge pull request #9857

332d92ffb epee: span::operator[] allow mut ref from const span (jeffro256)
This commit is contained in:
tobtoht
2025-04-23 16:13:36 +00:00

View File

@@ -109,8 +109,7 @@ namespace epee
constexpr std::size_t size() const noexcept { return len; }
constexpr std::size_t size_bytes() const noexcept { return size() * sizeof(value_type); }
T &operator[](size_t idx) noexcept { return ptr[idx]; }
const T &operator[](size_t idx) const noexcept { return ptr[idx]; }
constexpr T &operator[](size_t idx) const noexcept { return ptr[idx]; }
private:
T* ptr;