From 3819df6e378ffccf0e29465afe99c3b324c2aa70 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 13 Feb 2017 12:11:45 -0800 Subject: [PATCH] Properly qualify std::size_t (#448) --- include/gsl/gsl | 2 +- include/gsl/gsl_util | 8 +- include/gsl/multi_span | 146 ++++++++++++++++++------------------- include/gsl/span | 12 +-- include/gsl/string_span | 22 +++--- tests/bounds_tests.cpp | 66 ++++++++--------- tests/multi_span_tests.cpp | 12 +-- 7 files changed, 134 insertions(+), 134 deletions(-) diff --git a/include/gsl/gsl b/include/gsl/gsl index 43b27bc..c620a09 100644 --- a/include/gsl/gsl +++ b/include/gsl/gsl @@ -126,7 +126,7 @@ namespace std template struct hash> { - size_t operator()(const gsl::not_null& value) const { return hash{}(value); } + std::size_t operator()(const gsl::not_null& value) const { return hash{}(value); } }; } // namespace std diff --git a/include/gsl/gsl_util b/include/gsl/gsl_util index 164bf58..8961539 100644 --- a/include/gsl/gsl_util +++ b/include/gsl/gsl_util @@ -129,18 +129,18 @@ inline T narrow(U u) // // at() - Bounds-checked way of accessing static arrays, std::array, std::vector // -template +template inline constexpr T& at(T (&arr)[N], std::ptrdiff_t index) { Expects(index >= 0 && index < narrow_cast(N)); - return arr[static_cast(index)]; + return arr[static_cast(index)]; } -template +template inline constexpr T& at(std::array& arr, std::ptrdiff_t index) { Expects(index >= 0 && index < narrow_cast(N)); - return arr[static_cast(index)]; + return arr[static_cast(index)]; } template diff --git a/include/gsl/multi_span b/include/gsl/multi_span index dc5de4a..9100e69 100644 --- a/include/gsl/multi_span +++ b/include/gsl/multi_span @@ -94,16 +94,16 @@ namespace details }; } -template +template class index final { static_assert(Rank > 0, "Rank must be greater than 0!"); - template + template friend class index; public: - static const size_t rank = Rank; + static const std::size_t rank = Rank; using value_type = std::ptrdiff_t; using size_type = value_type; using reference = std::add_lvalue_reference_t; @@ -138,14 +138,14 @@ public: constexpr index& operator=(const index& rhs) GSL_NOEXCEPT = default; // Preconditions: component_idx < rank - constexpr reference operator[](size_t component_idx) + constexpr reference operator[](std::size_t component_idx) { Expects(component_idx < Rank); // Component index must be less than rank return elems[component_idx]; } // Preconditions: component_idx < rank - constexpr const_reference operator[](size_t component_idx) const GSL_NOEXCEPT + constexpr const_reference operator[](std::size_t component_idx) const GSL_NOEXCEPT { Expects(component_idx < Rank); // Component index must be less than rank return elems[component_idx]; @@ -311,24 +311,24 @@ namespace details BoundsRanges(const std::ptrdiff_t* const) {} BoundsRanges() = default; - template + template void serialize(T&) const { } - template + template size_type linearize(const T&) const { return 0; } - template + template size_type contains(const T&) const { return -1; } - size_type elementNum(size_t) const GSL_NOEXCEPT { return 0; } + size_type elementNum(std::size_t) const GSL_NOEXCEPT { return 0; } size_type totalSize() const GSL_NOEXCEPT { return TotalSize; } @@ -340,8 +340,8 @@ namespace details { using Base = BoundsRanges; using size_type = std::ptrdiff_t; - static const size_t Depth = Base::Depth + 1; - static const size_t DynamicNum = Base::DynamicNum + 1; + static const std::size_t Depth = Base::Depth + 1; + static const std::size_t DynamicNum = Base::DynamicNum + 1; static const size_type CurrentRange = dynamic_range; static const size_type TotalSize = dynamic_range; private: @@ -364,14 +364,14 @@ namespace details { } - template + template void serialize(T& arr) const { arr[Dim] = elementNum(); this->Base::template serialize(arr); } - template + template size_type linearize(const T& arr) const { const size_type index = this->Base::totalSize() * arr[Dim]; @@ -379,7 +379,7 @@ namespace details return index + this->Base::template linearize(arr); } - template + template size_type contains(const T& arr) const { const ptrdiff_t last = this->Base::template contains(arr); @@ -392,7 +392,7 @@ namespace details size_type elementNum() const GSL_NOEXCEPT { return totalSize() / this->Base::totalSize(); } - size_type elementNum(size_t dim) const GSL_NOEXCEPT + size_type elementNum(std::size_t dim) const GSL_NOEXCEPT { if (dim > 0) return this->Base::elementNum(dim - 1); @@ -412,8 +412,8 @@ namespace details { using Base = BoundsRanges; using size_type = std::ptrdiff_t; - static const size_t Depth = Base::Depth + 1; - static const size_t DynamicNum = Base::DynamicNum; + static const std::size_t Depth = Base::Depth + 1; + static const std::size_t DynamicNum = Base::DynamicNum; static const size_type CurrentRange = CurRange; static const size_type TotalSize = Base::TotalSize == dynamic_range ? dynamic_range : CurrentRange * Base::TotalSize; @@ -429,14 +429,14 @@ namespace details (void) firstLevel; } - template + template void serialize(T& arr) const { arr[Dim] = elementNum(); this->Base::template serialize(arr); } - template + template size_type linearize(const T& arr) const { Expects(arr[Dim] >= 0 && arr[Dim] < CurrentRange); // Index is out of range @@ -444,7 +444,7 @@ namespace details this->Base::template linearize(arr); } - template + template size_type contains(const T& arr) const { if (arr[Dim] >= CurrentRange) return -1; @@ -457,7 +457,7 @@ namespace details size_type elementNum() const GSL_NOEXCEPT { return CurrentRange; } - size_type elementNum(size_t dim) const GSL_NOEXCEPT + size_type elementNum(std::size_t dim) const GSL_NOEXCEPT { if (dim > 0) return this->Base::elementNum(dim - 1); @@ -486,20 +486,20 @@ namespace details const TypeChain& obj_; TypeListIndexer(const TypeChain& obj) : obj_(obj) {} - template + template const TypeChain& getObj(std::true_type) { return obj_; } - template + template auto getObj(std::false_type) -> decltype(TypeListIndexer(static_cast(obj_)).template get()) { return TypeListIndexer(static_cast(obj_)).template get(); } - template + template auto get() -> decltype(getObj(std::integral_constant())) { return getObj(std::integral_constant()); @@ -512,12 +512,12 @@ namespace details return TypeListIndexer(obj); } - template 1), + template 1), typename Ret = std::enable_if_t>> inline constexpr Ret shift_left(const index& other) GSL_NOEXCEPT { Ret ret{}; - for (size_t i = 0; i < Rank - 1; ++i) { + for (std::size_t i = 0; i < Rank - 1; ++i) { ret[i] = other[i + 1]; } return ret; @@ -546,8 +546,8 @@ class static_bounds friend class static_bounds; public: - static const size_t rank = MyRanges::Depth; - static const size_t dynamic_rank = MyRanges::DynamicNum; + static const std::size_t rank = MyRanges::Depth; + static const std::size_t dynamic_rank = MyRanges::DynamicNum; static const std::ptrdiff_t static_size = MyRanges::TotalSize; using size_type = std::ptrdiff_t; @@ -561,18 +561,18 @@ public: constexpr static_bounds(const static_bounds&) = default; - template + template struct BoundsRangeConvertible2; - template > static auto helpBoundsRangeConvertible(SourceType, TargetType, std::true_type) -> Ret; - template + template static auto helpBoundsRangeConvertible(SourceType, TargetType, ...) -> std::false_type; - template + template struct BoundsRangeConvertible2 : decltype(helpBoundsRangeConvertible( SourceType(), TargetType(), @@ -647,12 +647,12 @@ public: return m_ranges.contains(idx) != -1; } - constexpr size_type operator[](size_t index) const GSL_NOEXCEPT + constexpr size_type operator[](std::size_t index) const GSL_NOEXCEPT { return m_ranges.elementNum(index); } - template + template constexpr size_type extent() const GSL_NOEXCEPT { static_assert(Dim < rank, @@ -665,7 +665,7 @@ public: { static_assert(std::is_integral::value, "Dimension parameter must be supplied as an integral type."); - auto real_dim = narrow_cast(dim); + auto real_dim = narrow_cast(dim); Expects(real_dim < rank); return m_ranges.elementNum(real_dim); @@ -698,14 +698,14 @@ public: } }; -template +template class strided_bounds { - template + template friend class strided_bounds; public: - static const size_t rank = Rank; + static const std::size_t rank = Rank; using value_type = std::ptrdiff_t; using reference = std::add_lvalue_reference_t; using const_reference = std::add_const_t; @@ -740,7 +740,7 @@ public: constexpr size_type total_size() const GSL_NOEXCEPT { size_type ret = 0; - for (size_t i = 0; i < rank; ++i) { + for (std::size_t i = 0; i < rank; ++i) { ret += (m_extents[i] - 1) * m_strides[i]; } return ret + 1; @@ -749,7 +749,7 @@ public: constexpr size_type size() const GSL_NOEXCEPT { size_type ret = 1; - for (size_t i = 0; i < rank; ++i) { + for (std::size_t i = 0; i < rank; ++i) { ret *= m_extents[i]; } return ret; @@ -757,7 +757,7 @@ public: constexpr bool contains(const index_type& idx) const GSL_NOEXCEPT { - for (size_t i = 0; i < rank; ++i) { + for (std::size_t i = 0; i < rank; ++i) { if (idx[i] < 0 || idx[i] >= m_extents[i]) return false; } return true; @@ -766,7 +766,7 @@ public: constexpr size_type linearize(const index_type& idx) const GSL_NOEXCEPT { size_type ret = 0; - for (size_t i = 0; i < rank; i++) { + for (std::size_t i = 0; i < rank; i++) { Expects(idx[i] < m_extents[i]); // index is out of bounds of the array ret += idx[i] * m_strides[i]; } @@ -781,7 +781,7 @@ public: return {details::shift_left(m_extents), details::shift_left(m_strides)}; } - template + template constexpr size_type extent() const GSL_NOEXCEPT { static_assert(Dim < Rank, @@ -807,7 +807,7 @@ template struct is_bounds> : std::integral_constant { }; -template +template struct is_bounds> : std::integral_constant { }; @@ -819,7 +819,7 @@ private: using Base = std::iterator; public: - static const size_t rank = IndexType::rank; + static const std::size_t rank = IndexType::rank; using typename Base::reference; using typename Base::pointer; using typename Base::difference_type; @@ -840,7 +840,7 @@ public: constexpr bounds_iterator& operator++() GSL_NOEXCEPT { - for (size_t i = rank; i-- > 0;) { + for (std::size_t i = rank; i-- > 0;) { if (curr_[i] < boundary_[i] - 1) { curr_[i]++; return *this; @@ -863,12 +863,12 @@ public: { if (!less(curr_, boundary_)) { // if at the past-the-end, set to last element - for (size_t i = 0; i < rank; ++i) { + for (std::size_t i = 0; i < rank; ++i) { curr_[i] = boundary_[i] - 1; } return *this; } - for (size_t i = rank; i-- > 0;) { + for (std::size_t i = rank; i-- > 0;) { if (curr_[i] >= 1) { curr_[i]--; return *this; @@ -899,10 +899,10 @@ public: auto linear_idx = linearize(curr_) + n; std::remove_const_t stride = 0; stride[rank - 1] = 1; - for (size_t i = rank - 1; i-- > 0;) { + for (std::size_t i = rank - 1; i-- > 0;) { stride[i] = stride[i + 1] * boundary_[i + 1]; } - for (size_t i = 0; i < rank; ++i) { + for (std::size_t i = 0; i < rank; ++i) { curr_[i] = linear_idx / stride[i]; linear_idx = linear_idx % stride[i]; } @@ -953,7 +953,7 @@ public: private: constexpr bool less(index_type& one, index_type& other) const GSL_NOEXCEPT { - for (size_t i = 0; i < rank; ++i) { + for (std::size_t i = 0; i < rank; ++i) { if (one[i] < other[i]) return true; } return false; @@ -967,14 +967,14 @@ private: index_size_type res = 0; if (!less(idx, boundary_)) { res = 1; - for (size_t i = rank; i-- > 0;) { + for (std::size_t i = rank; i-- > 0;) { res += (idx[i] - 1) * multiplier; multiplier *= boundary_[i]; } } else { - for (size_t i = rank; i-- > 0;) { + for (std::size_t i = rank; i-- > 0;) { res += idx[i] * multiplier; multiplier *= boundary_[i]; } @@ -1015,7 +1015,7 @@ namespace details typename Bounds::size_type stride[Bounds::rank] = {}; stride[Bounds::rank - 1] = 1; - for (size_t i = 1; i < Bounds::rank; ++i) { + for (std::size_t i = 1; i < Bounds::rank; ++i) { stride[Bounds::rank - i - 1] = stride[Bounds::rank - i] * extents[Bounds::rank - i]; } return {stride}; @@ -1071,7 +1071,7 @@ template class multi_span; -template +template class strided_span; namespace details @@ -1080,7 +1080,7 @@ namespace details struct SpanTypeTraits { using value_type = T; - using size_type = size_t; + using size_type = std::size_t; }; template @@ -1184,7 +1184,7 @@ class multi_span public: using bounds_type = static_bounds; - static const size_t Rank = bounds_type::rank; + static const std::size_t Rank = bounds_type::rank; using size_type = typename bounds_type::size_type; using index_type = typename bounds_type::index_type; using value_type = ValueType; @@ -1272,7 +1272,7 @@ public: } // construct from n-dimensions static array - template > + template > constexpr multi_span(T (&arr)[N]) : multi_span(reinterpret_cast(arr), bounds_type{typename Helper::bounds_type{}}) { @@ -1293,7 +1293,7 @@ public: } // construct from std::array - template + template constexpr multi_span(std::array& arr) : multi_span(arr.data(), bounds_type{static_bounds{}}) { @@ -1305,7 +1305,7 @@ public: } // construct from const std::array - template + template constexpr multi_span(const std::array, N>& arr) : multi_span(arr.data(), static_bounds()) { @@ -1316,7 +1316,7 @@ public: } // prevent constructing from temporary std::array - template + template constexpr multi_span(std::array&& arr) = delete; // construct from containers @@ -1460,7 +1460,7 @@ public: static constexpr std::size_t rank() { return Rank; } - template + template constexpr size_type extent() const GSL_NOEXCEPT { static_assert(Dim < Rank, @@ -1598,7 +1598,7 @@ public: // reshape a multi_span into a different dimensionality // DimCount and Enabled here are workarounds for a bug in MSVC 2015 -template 0), typename = std::enable_if_t> inline constexpr auto as_multi_span(SpanType s, Dimensions2... dims) -> multi_span @@ -1641,7 +1641,7 @@ template inline constexpr auto as_multi_span(multi_span s) GSL_NOEXCEPT -> multi_span< const U, static_cast( multi_span::bounds_type::static_size != dynamic_range - ? (static_cast( + ? (static_cast( multi_span::bounds_type::static_size) / sizeof(U)) : dynamic_range)> @@ -1700,22 +1700,22 @@ inline constexpr auto as_multi_span(T* arr, std::ptrdiff_t len) -> return {reinterpret_cast*>(arr), len}; } -template +template inline constexpr auto as_multi_span(T (&arr)[N]) -> typename details::SpanArrayTraits::type { return {arr}; } -template +template inline constexpr multi_span as_multi_span(const std::array& arr) { return {arr}; } -template +template inline constexpr multi_span as_multi_span(const std::array&&) = delete; -template +template inline constexpr multi_span as_multi_span(std::array& arr) { return {arr}; @@ -1752,7 +1752,7 @@ inline constexpr auto as_multi_span(std::basic_string& // strided_span is an extension that is not strictly part of the GSL at this time. // It is kept here while the multidimensional interface is still being defined. -template +template class strided_span { public: @@ -1777,7 +1777,7 @@ private: friend iterator; friend const_iterator; - template + template friend class strided_span; public: @@ -1859,7 +1859,7 @@ public: constexpr bounds_type bounds() const GSL_NOEXCEPT { return bounds_; } - template + template constexpr size_type extent() const GSL_NOEXCEPT { static_assert(Dim < Rank, @@ -1974,7 +1974,7 @@ private: // memory that can contain a multiple of new type elements Expects(strides[Rank - 2] >= d && (strides[Rank - 2] % d == 0)); - for (size_t i = Rank - 1; i > 0; --i) { + for (std::size_t i = Rank - 1; i > 0; --i) { // Only strided arrays with regular strides can be resized Expects((strides[i - 1] >= strides[i]) && (strides[i - 1] % strides[i] == 0)); } @@ -2110,7 +2110,7 @@ public: using typename Base::value_type; private: - template + template friend class strided_span; const Span* m_container; diff --git a/include/gsl/span b/include/gsl/span index 79169f9..957c9e6 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -104,7 +104,7 @@ namespace details { }; - template + template struct is_std_array_oracle> : std::true_type { }; @@ -364,18 +364,18 @@ public: { } - template + template constexpr span(element_type (&arr)[N]) GSL_NOEXCEPT : storage_(&arr[0], details::extent_type()) { } - template > + template > constexpr span(std::array& arr) GSL_NOEXCEPT : storage_(&arr[0], details::extent_type()) { } - template + template constexpr span(const std::array, N>& arr) GSL_NOEXCEPT : storage_(&arr[0], details::extent_type()) { @@ -592,7 +592,7 @@ namespace details // if we only supported compilers with good constexpr support then // this pair of classes could collapse down to a constexpr function - // we should use a narrow_cast<> to go to size_t, but older compilers may not see it as + // we should use a narrow_cast<> to go to std::size_t, but older compilers may not see it as // constexpr // and so will fail compilation of the template template @@ -639,7 +639,7 @@ span make_span(ElementType* firstElem, ElementType* lastElem) { return span(firstElem, lastElem); } -template +template span make_span(ElementType (&arr)[N]) { return span(arr); } diff --git a/include/gsl/string_span b/include/gsl/string_span index 093cf9c..cd7f4b8 100644 --- a/include/gsl/string_span +++ b/include/gsl/string_span @@ -176,7 +176,7 @@ inline span ensure_z(const wchar_t* const& sz, st return {sz, len}; } -template +template span ensure_z(T (&sz)[N]) { return ensure_z(&sz[0], static_cast(N)); @@ -305,17 +305,17 @@ public: // From static arrays - if 0-terminated, remove 0 from the view // All other containers allow 0s within the length, so we do not remove them - template + template constexpr basic_string_span(element_type (&arr)[N]) : span_(remove_z(arr)) { } - template > + template > constexpr basic_string_span(std::array& arr) GSL_NOEXCEPT : span_(arr) { } - template > + template > constexpr basic_string_span(const std::array& arr) GSL_NOEXCEPT : span_(arr) { } @@ -427,7 +427,7 @@ private: return {sz, details::length_func()(sz, max)}; } - template + template static impl_type remove_z(element_type (&sz)[N]) { return remove_z(&sz[0], narrow_cast(N)); @@ -457,29 +457,29 @@ template std::basic_string::type> to_string(basic_string_span view) { - return {view.data(), static_cast(view.length())}; + return {view.data(), static_cast(view.length())}; } #else inline std::string to_string(cstring_span<> view) { - return {view.data(), static_cast(view.length())}; + return {view.data(), static_cast(view.length())}; } inline std::string to_string(string_span<> view) { - return {view.data(), static_cast(view.length())}; + return {view.data(), static_cast(view.length())}; } inline std::wstring to_string(cwstring_span<> view) { - return {view.data(), static_cast(view.length())}; + return {view.data(), static_cast(view.length())}; } inline std::wstring to_string(wstring_span<> view) { - return {view.data(), static_cast(view.length())}; + return {view.data(), static_cast(view.length())}; } #endif @@ -491,7 +491,7 @@ template std::basic_string to_basic_string(basic_string_span view) { - return {view.data(), static_cast(view.length())}; + return {view.data(), static_cast(view.length())}; } // zero-terminated string span, used to convert diff --git a/tests/bounds_tests.cpp b/tests/bounds_tests.cpp index a4024d1..57f358e 100644 --- a/tests/bounds_tests.cpp +++ b/tests/bounds_tests.cpp @@ -1,27 +1,27 @@ -/////////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) 2015 Microsoft Corporation. All rights reserved. -// -// This code is licensed under the MIT License (MIT). -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// +/////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) 2015 Microsoft Corporation. All rights reserved. +// +// This code is licensed under the MIT License (MIT). +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// /////////////////////////////////////////////////////////////////////////////// -#include +#include #include #include using namespace std; using namespace gsl; -namespace +namespace { void use(std::ptrdiff_t&) {} } @@ -37,56 +37,56 @@ SUITE(bounds_test) j++) { use(j); - use(point[static_cast(j)]); + use(point[static_cast(j)]); } } } - + TEST(bounds_basic) { static_bounds<3, 4, 5> b; auto a = b.slice(); - (void)a; + (void)a; static_bounds<4, dynamic_range, 2> x{ 4 }; x.slice().slice(); } - + TEST (arrayview_iterator) { static_bounds<4, dynamic_range, 2> bounds{ 3 }; - + auto itr = bounds.begin(); - (void)itr; + (void)itr; #ifdef CONFIRM_COMPILATION_ERRORS multi_span av(nullptr, bounds); - + auto itr2 = av.cbegin(); - + for (auto& v : av) { v = 4; } fill(av.begin(), av.end(), 0); -#endif +#endif } - + TEST (bounds_convertible) { static_bounds<7, 4, 2> b1; static_bounds<7, dynamic_range, 2> b2 = b1; - (void)b2; + (void)b2; #ifdef CONFIRM_COMPILATION_ERRORS - static_bounds<7, dynamic_range, 1> b4 = b2; + static_bounds<7, dynamic_range, 1> b4 = b2; #endif - + static_bounds b3 = b1; - static_bounds<7, 4, 2> b4 = b3; + static_bounds<7, 4, 2> b4 = b3; (void)b4; static_bounds b11; - + static_bounds b5; static_bounds<34> b6; - + b5 = static_bounds<20>(); CHECK_THROW(b6 = b5, fail_fast); b5 = static_bounds<34>(); @@ -94,7 +94,7 @@ SUITE(bounds_test) CHECK(b5 == b6); CHECK(b5.size() == b6.size()); - } + } } int main(int, const char *[]) diff --git a/tests/multi_span_tests.cpp b/tests/multi_span_tests.cpp index 2d23f85..31067f3 100644 --- a/tests/multi_span_tests.cpp +++ b/tests/multi_span_tests.cpp @@ -637,7 +637,7 @@ SUITE(multi_span_tests) #endif #ifdef CONFIRM_COMPILATION_ERRORS - static_bounds b12(b11); + static_bounds b12(b11); b12 = b11; b11 = b12; @@ -1291,8 +1291,8 @@ SUITE(multi_span_tests) CHECK(i1[0] == 0); // components of different types - size_t c0 = 0; - size_t c1 = 1; + std::size_t c0 = 0; + std::size_t c1 = 1; index<3> i2(c0, c1, 2); CHECK(i2[0] == 0); @@ -1319,7 +1319,7 @@ SUITE(multi_span_tests) CHECK(i1[0] == 0); // components of different types - size_t c0 = 0; + std::size_t c0 = 0; index<1> i2(c0); CHECK(i2[0] == 0); @@ -1674,7 +1674,7 @@ SUITE(multi_span_tests) for (auto& b : wav) { b = byte(0); } - for (size_t i = 0; i < 4; ++i) { + for (std::size_t i = 0; i < 4; ++i) { CHECK(a[i] == 0); } } @@ -1684,7 +1684,7 @@ SUITE(multi_span_tests) for (auto& n : av) { n = 1; } - for (size_t i = 0; i < 4; ++i) { + for (std::size_t i = 0; i < 4; ++i) { CHECK(a[i] == 1); } }