-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADT] Fix const-correctness issues in
zippy
This defines the iterator tuple based on the storage type of `zippy`, instead of its type arguments. This way, we can support temporaries that gets passed in and allow for them to be modified during iteration. Because the iterator types to the tuple storage can have different types when the storage is and isn't const, this defines a const iterator type and non-const `begin`/`end` functions. This way we avoid unintentional casts, e.g., trying to cast `vector<bool>::reference` to `vector<bool>::const_reference`, which may be unrelated types that are not convertible. This patch is a general and free-standing improvement but my primary use is in the implemention a version of `enumerate` that accepts multiple ranges: D144583. Reviewed By: dblaikie, zero9178 Differential Revision: https://reviews.llvm.org/D144834
- Loading branch information
Showing
2 changed files
with
157 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters