[libcxx-commits] [PATCH] D101729: [libcxx] deprecates `std::iterator` and removes it as a base class

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 4 14:57:16 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/include/iterator:629-631
+#if _LIBCPP_STD_VER > 14
+    typedef typename iterator_traits<_Iter>::value_type      value_type;
+#endif
----------------
cjdb wrote:
> Quuxplusone wrote:
> > Lose the `#if` here.
> > (Any idea why the old code bothered to redundantly redefine `difference_type` etc.?)
> According to https://timsong-cpp.github.io/cppwp/n4140/reverse.iterator, it's standard to do this :S
> I'm more curious to know why `value_type` is missing than why the others were redundantly added.
> 
> Does this change your opinion at all?
Nope, I'd still just drop the `#if`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101729



More information about the libcxx-commits mailing list