py::builtins::operator < (py::builtins::list)¶
Defined in <pypp/builtins/list.hpp>
template <class type, class allocator_a, class allocator_b>
bool operator < (const list<type, allocator_a>& lhs, const list<type, allocator_b>& rhs);
Checks whether a list is less than another list.
Return value¶
Whether lhs is less than rhs.
Complexity¶
\(O(n)\), where n = py::min(lhs.size(), rhs.size()).
Example¶
#include <pypp/builtins/list.hpp>
#include <pypp/builtins/print.hpp>
int main()
{
py::list<int> lhs{0, 9, 1, 3};
py::list<int> rhs{0, 9, 1, 4};
py::print(lhs < rhs);
}
Output:
true