diff --git a/view.hpp b/view.hpp index 068f6332..d1f86a7c 100644 --- a/view.hpp +++ b/view.hpp @@ -306,7 +306,9 @@ namespace cruft { [[nodiscard]] constexpr auto redim (size_type count) const { - assert (count > 0); + if constexpr (std::is_signed_v) + assert (count >= 0); + if (count > size ()) throw std::invalid_argument ("redim to higher size not allowed"); return view { m_begin, m_begin + count };