diff --git a/include/span.h b/include/span.h index 6fe3bff..fbed6f7 100644 --- a/include/span.h +++ b/include/span.h @@ -286,8 +286,8 @@ public: constexpr span_iterator() : base_type() {} constexpr span_iterator(const Span* span, typename Span::index_type index) : base_type(span, index) {} - constexpr reference operator*() const { return reinterpret_cast(base_type::operator*()); } - constexpr pointer operator->() const { return reinterpret_cast(base_type::operator->()); } + constexpr reference operator*() const { return const_cast(base_type::operator*()); } + constexpr pointer operator->() const { return const_cast(base_type::operator->()); } constexpr span_iterator& operator++() noexcept { base_type::operator++(); return *this; }