Don't shadow `pos`
@@ -540,8 +540,8 @@ bool Slice<T>::empty() const noexcept {
template <typename T>
T &Slice<T>::operator[](std::size_t n) const noexcept {
assert(n < this->size());
- auto pos = static_cast<char *>(slicePtr(this)) + size_of<T>() * n;
- return *reinterpret_cast<T *>(pos);
+ auto index = static_cast<char *>(slicePtr(this)) + size_of<T>() * n;
+ return *reinterpret_cast<T *>(index);
}
template <typename T>
@@ -579,8 +579,8 @@ Slice<T>::iterator::operator->() const noexcept {
template <typename T>
typename Slice<T>::iterator::reference Slice<T>::iterator::operator[](
typename Slice<T>::iterator::difference_type n) const noexcept {
- auto pos = static_cast<char *>(this->pos) + this->stride * n;
- return *reinterpret_cast<T *>(pos);
+ auto index = static_cast<char *>(this->pos) + this->stride * n;
+ return *reinterpret_cast<T *>(index);
}
template <typename T>
