[PATCH] D45853: (WIP) Alternate approach to reversing filtered iterators

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 20 12:54:16 PDT 2018


timshen added inline comments.


================
Comment at: include/llvm/ADT/STLExtras.h:298
           typename std::common_type<
-              std::forward_iterator_tag,
+              typename detail::fwd_or_bidi_tag<WrappedIteratorT>::type,
               typename std::iterator_traits<
----------------
Would `std::bidirectional_iterator_tag` simply work?


================
Comment at: include/llvm/ADT/STLExtras.h:309
   struct PayloadType {
+    WrappedIteratorT Begin;
     WrappedIteratorT End;
----------------
If WrappedIteratorT is not bidirectional, we don't need this data member. Maybe add a comment about this optimization opportunity?


https://reviews.llvm.org/D45853





More information about the llvm-commits mailing list