• Jeremy Apthorp's avatar
    qualify base::data and base::size in span.h · 6f7ee55a
    Jeremy Apthorp authored
    This fixes an ambiguous reference when building against MSSTL:
    
    In file included from ../../content/browser/webauth/virtual_authenticator.cc:5:
    In file included from ../..\content/browser/webauth/virtual_authenticator.h:16:
    In file included from ../..\device/fido/virtual_fido_device.h:17:
    ../..\base/containers/span.h(501,21): error: call to 'data' is ambiguous
      return span<T, N>(data(container), size(container));
                        ^~~~
    ../../content/browser/webauth/virtual_authenticator.cc(148,29): note: in instantiation of function template specialization 'base::make_span<32, std::vector<unsigned char, std::allocator<unsigned char> >, unsigned char, void>' requested here
    
                          base::make_span<device::kRpIdHashLength>(
                                ^
    _NODISCARD constexpr auto data(_Container& _Cont) -> decltype(_Cont.data()) { // get data() for container
                              ^
    ../..\base/stl_util.h(116,16): note: candidate function [with Container = std::vector<unsigned char, std::allocator<unsigned char> >]
    constexpr auto data(Container& c) -> decltype(c.data()) {
                   ^
    _NODISCARD constexpr auto data(const _Container& _Cont)
                              ^
    ../..\base/stl_util.h(133,16): note: candidate function [with Container = std::vector<unsigned char, std::allocator<unsigned char> >]
    constexpr auto data(const Container& c) -> decltype(c.data()) {
                   ^
    1 error generated.
    
    C: \projects\src\out\Default\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\xutility(1168,27): note: candidate function [with _Container = std::vector<unsigned char, std::allocator<unsigned char> >]
    C: \projects\src\out\Default\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\xutility(1173,27): note: candidate function [with _Container = std::vector<unsigned char, std::allocator<unsigned char> >]
    Change-Id: Icf64aecbc5501a9aa3a9938befef0a703745d5ac
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894264
    Commit-Queue: Jeremy Apthorp <jeremya@chromium.org>
    Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    Auto-Submit: Jeremy Apthorp <jeremya@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#711506}
    6f7ee55a
span.h 20.2 KB