[llvm] [ADT] Make concat able to handle ranges with iterators that return by value (such as zip) (PR #112783)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 17:35:58 PDT 2024
================
@@ -1065,27 +1075,30 @@ class concat_iterator
/// Returns null if the specified iterator is at the end. Otherwise,
/// dereferences the iterator and returns the address of the resulting
/// reference.
- template <size_t Index> ValueT *getHelper() const {
+ template <size_t Index> handle_type getHelper() const {
auto &Begin = std::get<Index>(Begins);
auto &End = std::get<Index>(Ends);
if (Begin == End)
- return nullptr;
+ return {};
----------------
dwblaikie wrote:
Not sure I understand the question/can picture what you're suggesting.
The helper function here is used to handle the variadic expansion of each kind of iterator/range being concatenated. I can't think of a particularly simpler way to do it?
https://github.com/llvm/llvm-project/pull/112783
More information about the llvm-commits
mailing list