[webkit-reviews] review granted: [Bug 177026] Allow WTF::map to use any class that is iterable and has a size getter : [Attachment 320974] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Sep 16 08:43:19 PDT 2017


Darin Adler <darin at apple.com> has granted youenn fablet <youennf at gmail.com>'s
request for review:
Bug 177026: Allow WTF::map to use any class that is iterable and has a size
getter
https://bugs.webkit.org/show_bug.cgi?id=177026

Attachment 320974: Patch

https://bugs.webkit.org/attachment.cgi?id=320974&action=review




--- Comment #4 from Darin Adler <darin at apple.com> ---
Comment on attachment 320974
  --> https://bugs.webkit.org/attachment.cgi?id=320974
Patch

If the result type is always Vector, then we should probably name this
something other than "map". Perhaps "mapToVector", which is less elegant, but
still.

I think we should consider basing this on std::begin, std::end, and std::size
rather than on x.begin(), x.end(), and x.size(). However, std::size is C++17,
so maybe we can’t rely on that.

http://en.cppreference.com/w/cpp/iterator/begin
http://en.cppreference.com/w/cpp/iterator/end
http://en.cppreference.com/w/cpp/iterator/size


More information about the webkit-reviews mailing list