WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 234117
Use simpler idioms for std::less and std::greater possible in modern C++
https://bugs.webkit.org/show_bug.cgi?id=234117
Summary
Use simpler idioms for std::less and std::greater possible in modern C++
Darin Adler
Reported
2021-12-09 18:06:51 PST
Use simpler idioms for std::less and std::greater possible in modern C++
Attachments
Patch
(4.39 KB, patch)
2021-12-09 18:09 PST
,
Darin Adler
no flags
Details
Formatted Diff
Diff
Patch
(4.40 KB, patch)
2021-12-09 20:26 PST
,
Darin Adler
andersca
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2021-12-09 18:09:21 PST
Created
attachment 446649
[details]
Patch
Darin Adler
Comment 2
2021-12-09 20:26:39 PST
Created
attachment 446657
[details]
Patch
Anders Carlsson
Comment 3
2021-12-10 10:07:35 PST
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?
Darin Adler
Comment 4
2021-12-10 10:13:32 PST
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.
Darin Adler
Comment 5
2021-12-10 10:18:14 PST
Committed
r286858
(?): <
https://commits.webkit.org/r286858
>
Radar WebKit Bug Importer
Comment 6
2021-12-10 10:19:20 PST
<
rdar://problem/86328234
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug