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

Tim Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 5 08:23:00 PDT 2021


tcanens 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
----------------
Quuxplusone wrote:
> 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`.
It redeclares things that it needs to use in the rest of the class, because name lookup doesn't look into dependent bases.


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