https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102589

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Overloading < for shared_ptr like that is a bit questionable anyway.

You can use std::lexicographical_compare with a custom comparison function if
you want the custom less-than behaviour:

    if (std::lexicographical_compare(largerMap.begin(), largerMap.end(),
smallerMap.begin(), smallerMap.end(), [](const auto& l, const auto& r) { return
l.first < r.first || (l.first == r.first && *l.second < *r.second); }))

This does the same thing in C++17 and C++20.

Reply via email to