Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace undefined std::Container<const T> with std::Container<T> #147

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

jonathan-dilorenzo
Copy link
Collaborator

@jonathan-dilorenzo jonathan-dilorenzo commented Sep 10, 2024

Replace undefined std::Container with std::Container

std::vector (and other container types:
deque/forward_list/list/multiset/queue/set/stack) are undefined and disallowed
by libstdc++. Future libc++ will report errors as well. Migrate to
std::Container to bring code in-line with the C++ standard and the behavior
of other C++ standard libraries. Make similar changes to absl::flat_hash_set.

See b/223663984: std::vector<const T> (and other container types:
deque/forward_list/list/multiset/queue/set/stack) are undefined and disallowed
by libstdc++. Future libc++ will report errors as well. Migrate to
std::Container<T> to bring code in-line with the C++ standard and the behavior
of other C++ standard libraries. Make similar changes to absl::flat_hash_set.

The clang-tidy check portability-std-allocator-const prevents backsliding.

LSC: http://go/replace-std-container-const-T

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:672175733:BASE:672157811:1725764372183:9462f
PiperOrigin-RevId: 672175733
@jonathan-dilorenzo jonathan-dilorenzo merged commit b4dd1a3 into master Sep 10, 2024
2 checks passed
@jonathan-dilorenzo jonathan-dilorenzo deleted the cl/672175733 branch September 10, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants