Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Issue 1360423002: Extend base::Reversed to support iterating arrays (Closed)

Created:
5 years, 3 months ago by mdempsky
Modified:
5 years, 1 month ago
Reviewers:
danakj
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Extend base::Reversed to support iterating arrays C++11's range-based for syntax supports iterating arrays, so it makes sense to support arrays in base::Reversed too. Committed: https://crrev.com/137978257f920ebdaa7d65493f39194a6a4a2e0c Cr-Commit-Position: refs/heads/master@{#354181}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Remove clang-format directives #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -2 lines) Patch
M base/containers/adapters.h View 1 3 chunks +24 lines, -1 line 0 comments Download
M base/containers/adapters_unittest.cc View 1 chunk +13 lines, -1 line 0 comments Download

Messages

Total messages: 12 (2 generated)
mdempsky
5 years, 3 months ago (2015-09-24 06:41:15 UTC) #2
danakj
Is this something that's provided by c++11 std library? I couldn't find it, but the ...
5 years, 2 months ago (2015-10-14 23:21:05 UTC) #3
mdempsky
On 2015/10/14 23:21:05, danakj wrote: > Is this something that's provided by c++11 std library? ...
5 years, 2 months ago (2015-10-14 23:39:12 UTC) #4
danakj
LGTM. I see, thanks! This is nice.
5 years, 2 months ago (2015-10-14 23:40:28 UTC) #5
mdempsky
On 2015/10/14 23:40:28, danakj wrote: > LGTM. I see, thanks! This is nice. Thanks!
5 years, 2 months ago (2015-10-14 23:45:00 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1360423002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1360423002/20001
5 years, 2 months ago (2015-10-14 23:45:29 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 2 months ago (2015-10-15 01:06:19 UTC) #9
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/137978257f920ebdaa7d65493f39194a6a4a2e0c Cr-Commit-Position: refs/heads/master@{#354181}
5 years, 2 months ago (2015-10-15 01:06:55 UTC) #10
danakj
On Wednesday, October 14, 2015, <mdempsky@chromium.org> wrote: > On 2015/10/14 23:21:05, danakj wrote: > >> ...
5 years, 1 month ago (2015-11-22 18:20:37 UTC) #11
mdempsky
5 years, 1 month ago (2015-11-23 17:44:46 UTC) #12
Message was sent while issue was closed.
On 2015/11/22 18:20:37, danakj (behind on reviews) wrote:
> Apparently there is this in C++14 :)
> http://en.cppreference.com/w/cpp/iterator/rbegin

Yep:

	 27   // TODO(mdempsky): Once we can use C++14 library features, use
std::rbegin
	 28   // and std::rend instead, so we can remove the specialization below.

One thing that occurs me now is we could backport std::r{begin,end} as
base::r{begin,end} and use them in base::Reversed.  Then once C++14 STL is
available, it's just a matter of deleting some code and
s/base(::r(begin|end))/std\1/g.

Worth preparing a CL for that, or just stick with what we have?

Powered by Google App Engine
This is Rietveld 408576698