[libcxx-commits] [PATCH] D81425: [libc++] Don't force a conversion to difference_type in std::advance

Marshall Clow via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 15 17:09:00 PDT 2020


mclow.lists added a comment.

In D81425#2080807 <https://reviews.llvm.org/D81425#2080807>, @ldionne wrote:

> I think it's weird to have a wide open template parameter like this in `std::distance`, but it appears to be what the Standard wants.


Personally, I think that this was a mistake in the original STL design. But there it is.

I think you need to do the same dance as `copy_n` does.

And make sure you don't break the `advance(bidi, -3)`. There was an LWG issue about that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81425





More information about the libcxx-commits mailing list