• Jan Wilken Dörrie's avatar
    [base] Clean Up make_span functions · b28b590d
    Jan Wilken Dörrie authored
    This change unifies the various base::make_span(container) utility
    functions and simply perfectly forwards the argument to the span
    constructor. Two overloads remain, one that deduces the span's
    extent automatically and one that let's the caller specify the extent.
    
    In order to do so this change introduces an internal::Extent struct,
    which is inspired by std::extent to deduce the right extent from the
    passed in argument. This helper is also used to simplify the internal
    EnableIfSpanCompatibleArray helper.
    
    Lastly it adds more tests to make sure make_span deduces the right type
    and extent.
    
    Bug: 828324
    
    Change-Id: Ib55fc25ab2ad4227daf05d427e0aadf77c671817
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1878367
    Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#712325}
    b28b590d
span_unittest.nc 9.92 KB