--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHq1K7QPiY%3DsgXU_%3DoOhe71Ty_9DrgfoXaZ8XpEMQuOrMZznLQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHtyhaSh6zPW7OFoqgcaJbS7LrfiZZ2tkomFKYs67Q0wZ-Prtg%40mail.gmail.com.
i.e., for the former, use std::set<std::string, std::less<>>
I actually don't think there's a concise way to do the same for std::unordered_set, though.
Some of our other containers, like base::flat_map, use transparent comparators by default.
Roland Bock
Software Engineering Manager
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
The above terms reflect a potential business arrangement, are provided solely as a basis for further discussion, and are not intended to be and do not constitute a legally binding obligation. No legally binding obligations will be created, implied, or inferred until an agreement in final form is executed in writing by all parties involved.
On Fri, Sep 16, 2022 at 5:48 PM Jeremy Roman <jbr...@chromium.org> wrote:i.e., for the former, use std::set<std::string, std::less<>>I see, that's neat :-)I actually don't think there's a concise way to do the same for std::unordered_set, though.That might be possible with C++20 if the hash functions are equivalent.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHq1K7RK-xnc9i41_S0naN8Ri0d7qDoAqO-s9amH0-3fXEhrGQ%40mail.gmail.com.
On Fri, 16 Sept 2022 at 08:53, 'Roland Bock' via Chromium-dev <chromi...@chromium.org> wrote:On Fri, Sep 16, 2022 at 5:48 PM Jeremy Roman <jbr...@chromium.org> wrote:i.e., for the former, use std::set<std::string, std::less<>>I see, that's neat :-)I actually don't think there's a concise way to do the same for std::unordered_set, though.That might be possible with C++20 if the hash functions are equivalent.We should rarely be using unordered_set and unordered_map, FWIW :)
Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHq1K7Q9fd-4wYwR1qYFVjBWvZCzHpqdXwkfM1dVDwH8SPiKfw%40mail.gmail.com.
Abseil's unordered containers already support heterogeneous access (https://abseil.io/tips/144), which might be another good reason to consider allowing them.