From c6d025453a2230731f32f9bce0f7cc18755bfd0a Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 16 Jan 2018 13:31:53 +1100 Subject: [PATCH] view: avoid signed comparison issues with sizes --- view.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/view.hpp b/view.hpp index 4fa7a60a..6821b8b7 100644 --- a/view.hpp +++ b/view.hpp @@ -37,6 +37,7 @@ namespace util { remove_restrict_t >::value_type; + using size_type = size_t; //--------------------------------------------------------------------- constexpr @@ -238,12 +239,12 @@ namespace util { constexpr auto size (void) const noexcept { - return static_cast (std::distance (m_begin, m_end)); + return static_cast (std::distance (m_begin, m_end)); } //--------------------------------------------------------------------- [[gnu::warn_unused_result]] constexpr auto - redim (int count) const + redim (size_type count) const { assert (count > 0); if (count > size ())