Allow `base::RangeAsRvalues()` to model a bidirectional range [chromium/src : main]

0 views
Skip to first unread message

Daniel Cheng (Gerrit)

unread,
2:37 AM (12 hours ago) 2:37 AM
to Daniel Cheng, Jan Wilken Dörrie, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Andrew Rayskiy, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, Peter Beverloo, Rijubrata Bhaumik, Stephen Chenney, Simon Hangl, abigailbk...@google.com, alexmo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cblume+im...@chromium.org, chasej...@chromium.org, chfreme...@chromium.org, creis...@chromium.org, cwalle...@chromium.org, devtools-re...@chromium.org, dibyapal+wa...@chromium.org, dmurph+wa...@chromium.org, dom+...@chromium.org, dtapuska+...@chromium.org, dtseng...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, feature-me...@chromium.org, fmalit...@chromium.org, francisjp...@google.com, hiroshig...@chromium.org, iclella...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org, jophba...@chromium.org, josiah...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, mbarowsky+watc...@chromium.org, mfoltz+wa...@chromium.org, navigation...@chromium.org, nektar...@chromium.org, pdr+svgw...@chromium.org, ricea...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, yhiran...@chromium.org, yuzo+...@chromium.org
Attention needed from Jan Wilken Dörrie

Daniel Cheng added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Daniel Cheng . resolved

I noticed this while tinkering with random Blink stuff.

Open in Gerrit

Related details

Attention is currently required from:
  • Jan Wilken Dörrie
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I75d47beec4b9cef7761b5f066fe24601267f9b24
Gerrit-Change-Number: 7634589
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Jan Wilken Dörrie <jdoe...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Andrew Rayskiy <green...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Peter Beverloo <pe...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
Gerrit-CC: Simon Hangl <sim...@google.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Jan Wilken Dörrie <jdoe...@chromium.org>
Gerrit-Comment-Date: Thu, 05 Mar 2026 07:37:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Jan Wilken Dörrie (Gerrit)

unread,
9:31 AM (5 hours ago) 9:31 AM
to Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Andrew Rayskiy, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, Peter Beverloo, Rijubrata Bhaumik, Stephen Chenney, Simon Hangl, abigailbk...@google.com, alexmo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cblume+im...@chromium.org, chasej...@chromium.org, chfreme...@chromium.org, creis...@chromium.org, cwalle...@chromium.org, devtools-re...@chromium.org, dibyapal+wa...@chromium.org, dmurph+wa...@chromium.org, dom+...@chromium.org, dtapuska+...@chromium.org, dtseng...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, feature-me...@chromium.org, fmalit...@chromium.org, francisjp...@google.com, hiroshig...@chromium.org, iclella...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org, jophba...@chromium.org, josiah...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, mbarowsky+watc...@chromium.org, mfoltz+wa...@chromium.org, navigation...@chromium.org, nektar...@chromium.org, pdr+svgw...@chromium.org, ricea...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, yhiran...@chromium.org, yuzo+...@chromium.org
Attention needed from Daniel Cheng

Jan Wilken Dörrie voted and added 1 comment

Votes added by Jan Wilken Dörrie

Code-Review+1

1 comment

File base/containers/adapters_internal.h
Line 58, Patchset 2 (Latest): return std::make_move_iterator(std::ranges::rbegin(range_));
Jan Wilken Dörrie . unresolved

nit: `std::move_iterator` should also work due to CTAD: https://stackoverflow.com/a/57762216

That said, I believe changing `RangeOfRvaluesAdapter` shouldn't be necessary if you used `std::ranges::rbegin` etc instead of `std::rbegin` in `ReversedAdapter`. `std::ranges::rbegin` will try to find a `rbegin` member function, but if it fails it'll construct a `std::reverse_iterator` from `begin()` which would be correct here.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Thu, 05 Mar 2026 14:31:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    1:04 PM (1 hour ago) 1:04 PM
    to Daniel Cheng, Jan Wilken Dörrie, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Andrew Rayskiy, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, Peter Beverloo, Rijubrata Bhaumik, Stephen Chenney, Simon Hangl, abigailbk...@google.com, alexmo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cblume+im...@chromium.org, chasej...@chromium.org, chfreme...@chromium.org, creis...@chromium.org, cwalle...@chromium.org, devtools-re...@chromium.org, dibyapal+wa...@chromium.org, dmurph+wa...@chromium.org, dom+...@chromium.org, dtapuska+...@chromium.org, dtseng...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, feature-me...@chromium.org, fmalit...@chromium.org, francisjp...@google.com, hiroshig...@chromium.org, iclella...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org, jophba...@chromium.org, josiah...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, mbarowsky+watc...@chromium.org, mfoltz+wa...@chromium.org, navigation...@chromium.org, nektar...@chromium.org, pdr+svgw...@chromium.org, ricea...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, yhiran...@chromium.org, yuzo+...@chromium.org

    Daniel Cheng added 1 comment

    File base/containers/adapters_internal.h
    Line 58, Patchset 2 (Latest): return std::make_move_iterator(std::ranges::rbegin(range_));
    Jan Wilken Dörrie . resolved

    nit: `std::move_iterator` should also work due to CTAD: https://stackoverflow.com/a/57762216

    That said, I believe changing `RangeOfRvaluesAdapter` shouldn't be necessary if you used `std::ranges::rbegin` etc instead of `std::rbegin` in `ReversedAdapter`. `std::ranges::rbegin` will try to find a `rbegin` member function, but if it fails it'll construct a `std::reverse_iterator` from `begin()` which would be correct here.

    Daniel Cheng

    I'm going to land this as-is, but I will address your feedback in a followup; it'll just be rather intrusive since I need to go fix other things to satisfy ranges constraints.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Gerrit-Comment-Date: Thu, 05 Mar 2026 18:04:16 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Jan Wilken Dörrie <jdoe...@chromium.org>
      satisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      1:19 PM (1 hour ago) 1:19 PM
      to Daniel Cheng, Jan Wilken Dörrie, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Andrew Rayskiy, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, Peter Beverloo, Rijubrata Bhaumik, Stephen Chenney, Simon Hangl, abigailbk...@google.com, alexmo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cblume+im...@chromium.org, chasej...@chromium.org, chfreme...@chromium.org, creis...@chromium.org, cwalle...@chromium.org, devtools-re...@chromium.org, dibyapal+wa...@chromium.org, dmurph+wa...@chromium.org, dom+...@chromium.org, dtapuska+...@chromium.org, dtseng...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, feature-me...@chromium.org, fmalit...@chromium.org, francisjp...@google.com, hiroshig...@chromium.org, iclella...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org, jophba...@chromium.org, josiah...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, mbarowsky+watc...@chromium.org, mfoltz+wa...@chromium.org, navigation...@chromium.org, nektar...@chromium.org, pdr+svgw...@chromium.org, ricea...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, yhiran...@chromium.org, yuzo+...@chromium.org

      Daniel Cheng voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I75d47beec4b9cef7761b5f066fe24601267f9b24
      Gerrit-Change-Number: 7634589
      Gerrit-PatchSet: 3
      Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Jan Wilken Dörrie <jdoe...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Andrew Rayskiy <green...@google.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Fredrik Söderquist <f...@opera.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-CC: Peter Beverloo <pe...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-CC: Rijubrata Bhaumik <rijubrat...@intel.com>
      Gerrit-CC: Simon Hangl <sim...@google.com>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Comment-Date: Thu, 05 Mar 2026 18:19:39 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      1:22 PM (1 hour ago) 1:22 PM
      to Daniel Cheng, Jan Wilken Dörrie, Akihiro Ota, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Andrew Rayskiy, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, Peter Beverloo, Rijubrata Bhaumik, Stephen Chenney, Simon Hangl, abigailbk...@google.com, alexmo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cblume+im...@chromium.org, chasej...@chromium.org, chfreme...@chromium.org, creis...@chromium.org, cwalle...@chromium.org, devtools-re...@chromium.org, dibyapal+wa...@chromium.org, dmurph+wa...@chromium.org, dom+...@chromium.org, dtapuska+...@chromium.org, dtseng...@chromium.org, edgesto...@microsoft.com, enne...@chromium.org, feature-me...@chromium.org, fmalit...@chromium.org, francisjp...@google.com, hiroshig...@chromium.org, iclella...@chromium.org, ipc-securi...@chromium.org, jbroma...@chromium.org, jophba...@chromium.org, josiah...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, mbarowsky+watc...@chromium.org, mfoltz+wa...@chromium.org, navigation...@chromium.org, nektar...@chromium.org, pdr+svgw...@chromium.org, ricea...@chromium.org, tommyw+w...@chromium.org, video-networking...@google.com, yhiran...@chromium.org, yuzo+...@chromium.org

      Chromium LUCI CQ submitted the change

      Unreviewed changes

      2 is the latest approved patch-set.
      No files were changed between the latest approved patch-set and the submitted one.

      Change information

      Commit message:
      Allow `base::RangeAsRvalues()` to model a bidirectional range

      This allows the `base::Reversed()` adapter to be used with
      `base::RangeAsRvalues()`.
      Bug: 487938766
      Change-Id: I75d47beec4b9cef7761b5f066fe24601267f9b24
      Commit-Queue: Daniel Cheng <dch...@chromium.org>
      Reviewed-by: Jan Wilken Dörrie <jdoe...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1594790}
      Files:
      • M base/containers/adapters_internal.h
      • M base/containers/adapters_unittest.cc
      Change size: S
      Delta: 2 files changed, 26 insertions(+), 0 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Jan Wilken Dörrie
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I75d47beec4b9cef7761b5f066fe24601267f9b24
      Gerrit-Change-Number: 7634589
      Gerrit-PatchSet: 4
      Gerrit-Owner: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Jan Wilken Dörrie <jdoe...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Andrew Rayskiy <green...@google.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages