[PATCH] D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 16:12:53 PDT 2020


dblaikie added a comment.

I'm not sure if this addresses my concern - it doesn't chance the iterator category, which seems like the main problem (if the functor returns by value, I think the iterator category must be downgraded to "input")

If I'm understanding the proposed change correctly - this is saying "if the return type of the functor is the same as the value type of the underlying iterator - then the pointer type can be transparent, otherwise it's "pointer to FuncReturnTy" - but that seems incorrect/like it introduces a new bug. Even if the return type is the same as the value type, the fact that the functor's return value is a temporary in the "op*" means returning a pointer or reference to it would be incorrect/leave a dangling pointer, right?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79740/new/

https://reviews.llvm.org/D79740





More information about the llvm-commits mailing list