Namespaces
Variants
Views
Actions

std::operator ==,!=,<,<=,>,>= (std::span)

From cppreference.com
< cpp‎ | container‎ | span
template <class T, std::ptrdiff_t X, class U, std::ptrdiff_t Y>
constexpr bool operator==(std::span<T, X> l, std::span<U, Y> r);
(1)
template <class T, std::ptrdiff_t X, class U, std::ptrdiff_t Y>
constexpr bool operator!=(std::span<T, X> l, std::span<U, Y> r);
(2)
template <class T, std::ptrdiff_t X, class U, std::ptrdiff_t Y>
constexpr bool operator<(std::span<T, X> l, std::span<U, Y> r);
(3)
template <class T, std::ptrdiff_t X, class U, std::ptrdiff_t Y>
constexpr bool operator<=(std::span<T, X> l, std::span<U, Y> r);
(4)
template <class T, std::ptrdiff_t X, class U, std::ptrdiff_t Y>
constexpr bool operator>(std::span<T, X> l, std::span<U, Y> r);
(5)
template <class T, std::ptrdiff_t X, class U, std::ptrdiff_t Y>
constexpr bool operator>=(std::span<T, X> l, std::span<U, Y> r);
(6)

Lexicographically compare the contents of two spans.

1) Equivalent to return std::equal(l.begin(), l.end(), r.begin(), r.end());.
2) Equivalent to return !(l == r);.
3) Equivalent to return std::lexicographical_compare(l.begin(), l.end(), r.begin(), r.end());.
4) Equivalent to return !(r < l);.
5) Equivalent to return (r < l);.
6) Equivalent to return !(l < r);.

[edit] Parameters

l, r - spans to compare

[edit] Return value

The result of the comparison.