diff options
author | Isaac Goldberg <isaac@figma.com> | 2021-08-26 13:16:57 -0700 |
---|---|---|
committer | Isaac Goldberg <isaac@figma.com> | 2021-08-26 13:17:15 -0700 |
commit | c3fc2a4b386a32cbe5fd475760552fd4997c3d13 (patch) | |
tree | de8edd6756d5b595c38dca7191ed81f135087a34 /include | |
parent | 921629cfb59f17018ff8f082b2b3d3b6d74f2aad (diff) | |
download | cxx-c3fc2a4b386a32cbe5fd475760552fd4997c3d13.tar.gz |
Switch from 'index' to 'ptr'
Diffstat (limited to 'include')
-rw-r--r-- | include/cxx.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/cxx.h b/include/cxx.h index d19e318e..de0e3155 100644 --- a/include/cxx.h +++ b/include/cxx.h @@ -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 index = static_cast<char *>(slicePtr(this)) + size_of<T>() * n; - return *reinterpret_cast<T *>(index); + auto ptr = static_cast<char *>(slicePtr(this)) + size_of<T>() * n; + return *reinterpret_cast<T *>(ptr); } 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 index = static_cast<char *>(this->pos) + this->stride * n; - return *reinterpret_cast<T *>(index); + auto ptr = static_cast<char *>(this->pos) + this->stride * n; + return *reinterpret_cast<T *>(ptr); } template <typename T> |