Bug 231728

Summary: Remove std::iterator usage
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, benjamin, cdumez, cmarcelo, darin, esprehn+autocc, ews-watchlist, kangil.han, keith_miller, saam, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch none

Description Yusuke Suzuki 2021-10-14 02:24:14 PDT
[WTF] Remove std::iterator usage
Comment 1 Yusuke Suzuki 2021-10-14 02:27:47 PDT
Created attachment 441195 [details]
Patch
Comment 2 Yusuke Suzuki 2021-10-14 02:38:06 PDT
Created attachment 441196 [details]
Patch
Comment 3 Keith Miller 2021-10-14 06:26:40 PDT
Comment on attachment 441196 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=441196&action=review

> Source/WebCore/platform/Timer.cpp:336
> +    std::push_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + m_heapItem->heapIndex() + 1), TimerHeapLessThanFunction());

What's the deal here? I don't see where we're `using std::push_heap` anywhere. Is that in a different file?
Comment 4 Darin Adler 2021-10-14 09:04:46 PDT
Comment on attachment 441196 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=441196&action=review

>> Source/WebCore/platform/Timer.cpp:336
>> +    std::push_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + m_heapItem->heapIndex() + 1), TimerHeapLessThanFunction());
> 
> What's the deal here? I don't see where we're `using std::push_heap` anywhere. Is that in a different file?

Presumably, because there was a type from namespace std involved, we didn’t have to write std::push_heap because of argument-dependent lookup <https://en.cppreference.com/w/cpp/language/adl>. Now the types have changed, and so we have to explicitly specify std.
Comment 5 EWS 2021-10-14 09:39:45 PDT
Committed r284167 (242987@main): <https://commits.webkit.org/242987@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441196 [details].
Comment 6 Radar WebKit Bug Importer 2021-10-14 09:40:19 PDT
<rdar://problem/84259492>
Comment 7 Yusuke Suzuki 2021-10-14 10:09:35 PDT
Yup. That change was necessary because of ADL.