diff options
author | Abseil Team <absl-team@google.com> | 2024-03-07 12:13:34 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-03-07 12:14:29 -0800 |
commit | e968256406fd7898d7fde880e31e54b041d32a7e (patch) | |
tree | c4d62cc99f3184c89b2227af78480381f19dff05 /absl/algorithm/container_test.cc | |
parent | d03f54ef130a3070965618eae4e0e8f97cdd4ca6 (diff) | |
download | abseil-e968256406fd7898d7fde880e31e54b041d32a7e.tar.gz abseil-e968256406fd7898d7fde880e31e54b041d32a7e.tar.bz2 abseil-e968256406fd7898d7fde880e31e54b041d32a7e.zip |
Work around an implicit conversion signedness compiler warning
Addition and subtraction operators std::array::iterator are defined only for
ptrdiff_t, which is signed, instead of size_t, which is unsigned. Therefore,
adding the index variable to ar.begin() will trigger -Wsign-conversion if
std::array::iterator is not a raw pointer because the index variable will be
implicitly converted from size_t (an unsigned type) to ptrdiff_t (a signed
type). To fix this, we explicitly static_cast index to a ptrdiff_t.
PiperOrigin-RevId: 613662928
Change-Id: I5e06c2261d7b8f167fae7bb6acece076257f8579
Diffstat (limited to 'absl/algorithm/container_test.cc')
0 files changed, 0 insertions, 0 deletions