py::builtins::operator == (py::builtins::range)¶
Defined in <pypp/builtins/range.hpp>
template <class type>
constexpr bool operator == (const range<type>& lhs, const range<type>& rhs);
Compares two ranges for equality.
Note
Ranges are compared by the values hold by range, not by
specifications of them, for example
range(0, 4, 2) == range(0, 3, 2) returns true.
Return value¶
Whether lhs is equal to rhs.
Complexity¶
\(O(n)\), where n = py::min(lhs.size(), rhs.size()).
Example¶
#include <pypp/builtins/range.hpp>
#include <pypp/builtins/print.hpp>
int main()
{
py::range<int> lhs(9);
py::range<int> rhs(9);
py::print(lhs == rhs);
}
Output:
true