diff --git a/include/span.h b/include/span.h index 72d55d6..31c26ad 100644 --- a/include/span.h +++ b/include/span.h @@ -1818,7 +1818,7 @@ public: auto d = narrow_cast(sizeof(OtherValueType) / sizeof(value_type)); size_type size = this->bounds().total_size() / d; - return {(OtherValueType*) this->data(), size, + return {const_cast(reinterpret_cast(this->data())), size, bounds_type{resize_extent(this->bounds().index_bounds(), d), resize_stride(this->bounds().strides(), d)}}; }