| Summary: | Use simpler idioms for std::less and std::greater possible in modern C++ | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Darin Adler <darin> | ||||||
| Component: | WebKit Misc. | Assignee: | Darin Adler <darin> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | andersca, benjamin, cdumez, cmarcelo, ews-watchlist, thorton, webkit-bug-importer | ||||||
| Priority: | P3 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
|
Description
Darin Adler
2021-12-09 18:06:51 PST
Created attachment 446649 [details]
Patch
Created attachment 446657 [details]
Patch
Comment on attachment 446657 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446657&action=review > Source/WTF/wtf/ListDump.h:124 > + return sortedListDump(list, std::less<>(), comma); Is there a reason why std::less() does not work here? Maybe because it's in an uninstantiated context? Comment on attachment 446657 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=446657&action=review >> Source/WTF/wtf/ListDump.h:124 >> + return sortedListDump(list, std::less<>(), comma); > > Is there a reason why std::less() does not work here? Maybe because it's in an uninstantiated context? I know it doesn’t because my earlier patch failed to compile (gcc), but it did seem to compile locally (clang), so it might be a workaround for a gcc bug. I suspect it has something to do with the fact that the comparator argument to sortedListDump is "const Comparator&" and the comparator argument to sort is "Comparator", but the fact that it does seem to work in clang confuses me a bit. Committed r286858 (?): <https://commits.webkit.org/r286858> |