diff --git a/include/gsl/span b/include/gsl/span index 51b46f2..2deead0 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -199,7 +199,7 @@ namespace details constexpr span_iterator& operator-=(difference_type n) GSL_NOEXCEPT { return *this += -n; } - constexpr difference_type operator-(const span_iterator& rhs) const GSL_NOEXCEPT + constexpr difference_type operator-(span_iterator rhs) const GSL_NOEXCEPT { Expects(span_ == rhs.span_); return index_ - rhs.index_; @@ -210,39 +210,39 @@ namespace details return *(*this + n); } - constexpr friend bool operator==(const span_iterator& lhs, - const span_iterator& rhs) GSL_NOEXCEPT + constexpr friend bool operator==(span_iterator lhs, + span_iterator rhs) GSL_NOEXCEPT { return lhs.span_ == rhs.span_ && lhs.index_ == rhs.index_; } - constexpr friend bool operator!=(const span_iterator& lhs, - const span_iterator& rhs) GSL_NOEXCEPT + constexpr friend bool operator!=(span_iterator lhs, + span_iterator rhs) GSL_NOEXCEPT { return !(lhs == rhs); } - constexpr friend bool operator<(const span_iterator& lhs, - const span_iterator& rhs) GSL_NOEXCEPT + constexpr friend bool operator<(span_iterator lhs, + span_iterator rhs) GSL_NOEXCEPT { Expects(lhs.span_ == rhs.span_); return lhs.index_ < rhs.index_; } - constexpr friend bool operator<=(const span_iterator& lhs, - const span_iterator& rhs) GSL_NOEXCEPT + constexpr friend bool operator<=(span_iterator lhs, + span_iterator rhs) GSL_NOEXCEPT { return !(rhs < lhs); } - constexpr friend bool operator>(const span_iterator& lhs, - const span_iterator& rhs) GSL_NOEXCEPT + constexpr friend bool operator>(span_iterator lhs, + span_iterator rhs) GSL_NOEXCEPT { return rhs < lhs; } - constexpr friend bool operator>=(const span_iterator& lhs, - const span_iterator& rhs) GSL_NOEXCEPT + constexpr friend bool operator>=(span_iterator lhs, + span_iterator rhs) GSL_NOEXCEPT { return !(rhs > lhs); } @@ -255,7 +255,7 @@ namespace details template inline constexpr span_iterator operator+(typename span_iterator::difference_type n, - const span_iterator& rhs) GSL_NOEXCEPT + span_iterator rhs) GSL_NOEXCEPT { return rhs + n; } @@ -263,7 +263,7 @@ namespace details template inline constexpr span_iterator operator-(typename span_iterator::difference_type n, - const span_iterator& rhs) GSL_NOEXCEPT + span_iterator rhs) GSL_NOEXCEPT { return rhs - n; } @@ -548,43 +548,43 @@ private: // [span.comparison], span comparison operators template -inline constexpr bool operator==(const span& l, - const span& r) +inline constexpr bool operator==(span l, + span r) { return std::equal(l.begin(), l.end(), r.begin(), r.end()); } template -inline constexpr bool operator!=(const span& l, - const span& r) +inline constexpr bool operator!=(span l, + span r) { return !(l == r); } template -inline constexpr bool operator<(const span& l, - const span& r) +inline constexpr bool operator<(span l, + span r) { return std::lexicographical_compare(l.begin(), l.end(), r.begin(), r.end()); } template -inline constexpr bool operator<=(const span& l, - const span& r) +inline constexpr bool operator<=(span l, + span r) { return !(l > r); } template -inline constexpr bool operator>(const span& l, - const span& r) +inline constexpr bool operator>(span l, + span r) { return r < l; } template -inline constexpr bool operator>=(const span& l, - const span& r) +inline constexpr bool operator>=(span l, + span r) { return !(l < r); } @@ -675,7 +675,7 @@ span make_span(Ptr& cont) // Specialization of gsl::at for span template -inline constexpr ElementType& at(const span& s, std::ptrdiff_t index) +inline constexpr ElementType& at(span s, std::ptrdiff_t index) { // No bounds checking here because it is done in span::operator[] called below return s[index];