[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 17:50:57 PDT 2020


dblaikie added a comment.

I don't think this is correct either - the mapping function might return by reference - in which case changing it to return by value would probably be not what the user wants. Also, the iterator requirements state that for a forward iterator (or any refinement of that) the reference type must be "T&" (http://eel.is/c++draft/forward.iterators#1.3), so this would not conform to those requirements & I think the right/necessary thing to do is to downgrade the iterator category to "input iterator" in the case where the functor returns by value.


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

https://reviews.llvm.org/D79740





More information about the llvm-commits mailing list