[libcxx-commits] [PATCH] D75905: [libc++][P1115][C++20] Improving the Return Value of Erase-Like Algorithms II: Free erase/erase if.

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 11 20:23:47 PDT 2020


EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.
Herald added a reviewer: libc++.

I think there is a bug in the paper, but I think the return type should be `difference_type` not `size_type`.
The paper says the return value is equivalent to:

  auto r = distance(a, b);
  return r;

And `std::distance` returns `difference_type`.

What do you think?



================
Comment at: libcxx/include/functional:3087
+
+  for (typename _Container::iterator __iter = __c.begin(), __last = __c.end();
+       __iter != __last;) {
----------------
We need to avoid calling an overloaded comma operator here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75905





More information about the libcxx-commits mailing list