• Jan Wilken Dörrie's avatar
    [base] Ranges: constexpr for_each · 29574a2b
    Jan Wilken Dörrie authored
    Following making invoke() constexpr this change also adds constexpr
    support to ranges::for_each. This is done by no longer dispatching to
    the std:: implementation, but rather implementing the loop ourselves.
    This change furthermore reduces the delta to C++20 by using the right
    return type for ranges::for_each, as well as adding an implementation of
    range::for_each_n.
    
    Bug: 1071094
    Change-Id: Ic619f0c9926ef9c3e9fda4a67ab5e02bb5262402
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2325920Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#792848}
    29574a2b
algorithm_unittest.cc 31.8 KB