Slight tidy-up to precondition checking in span.

This commit is contained in:
Neil MacIntosh 2016-07-20 09:00:10 -07:00
parent 0c1b6717c1
commit 5e7771f879

View File

@ -380,7 +380,7 @@ public:
{} {}
constexpr span(pointer ptr, index_type count) : storage_(ptr, count) constexpr span(pointer ptr, index_type count) : storage_(ptr, count)
{ Expects((!ptr && count == 0) || (ptr && count >= 0)); } {}
constexpr span(pointer firstElem, pointer lastElem) constexpr span(pointer firstElem, pointer lastElem)
: storage_(firstElem, std::distance(firstElem, lastElem)) : storage_(firstElem, std::distance(firstElem, lastElem))
@ -575,7 +575,8 @@ private:
public: public:
template <class OtherExtentType> template <class OtherExtentType>
constexpr storage_type(pointer data, OtherExtentType ext) 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 constexpr inline pointer data() const noexcept
{ return data_; } { return data_; }