From 5e7771f879b6496dc10f17f94aace3faf70c6f71 Mon Sep 17 00:00:00 2001 From: Neil MacIntosh Date: Wed, 20 Jul 2016 09:00:10 -0700 Subject: [PATCH] Slight tidy-up to precondition checking in span. --- include/span.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/span.h b/include/span.h index fbed6f7..13e57ae 100644 --- a/include/span.h +++ b/include/span.h @@ -380,7 +380,7 @@ public: {} constexpr span(pointer ptr, index_type count) : storage_(ptr, count) - { Expects((!ptr && count == 0) || (ptr && count >= 0)); } + {} constexpr span(pointer firstElem, pointer lastElem) : storage_(firstElem, std::distance(firstElem, lastElem)) @@ -575,7 +575,8 @@ private: public: template constexpr storage_type(pointer data, OtherExtentType ext) - : ExtentType(ext), data_(data) {} + : ExtentType(ext), data_(data) + { Expects((!data && size() == 0) || (data && size() >= 0)); } constexpr inline pointer data() const noexcept { return data_; }