Don’t assume `QuicheStringPiece::const_iterator` is a `const char*`
Explicitly convert a `QuicheStringPiece::const_iterator` to `const char*` before trying to initialize a `QuicheStringPiece` with it. This is technically required by the standard – `std::string_view` (to which `QuicheStringPiece` decays in C++17 mode) only has
std::string_view::string_view(const char*, size_t);
std::string_view::string_view(const char*);
and not
std::string_view::string_view(std::string_view::const_iterator);
In practice, this isn’t generally an issue, because most STL implementations use `const char*` as the `string_view` iterator type. MSVC, however, uses a struct for the iterator and therefore requires the explicit conversion.
Thanks go to Yifan Yang <needyyang@google.com>, who identified this issue.
PiperOrigin-RevId: 320031927
Change-Id: If81aff793fac2db7202b5df0d02f86147fc3a658
1 file changed