[libcxx-commits] [PATCH] D149826: [libc++][ranges] Implement the changes to vector from P1206 (`ranges::to`):

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 12 11:42:24 PDT 2023


ldionne added a comment.

I must say I agree with @philnik here. Iterators are supposed to be copyable, and implementations are free to use that in their implementation as a detail. For example, here we're just passing the iterators down to another function. We can see that GCC also does not accept this code: https://godbolt.org/z/7GhGf8Exo

I don't think it would be reasonable to provide a ad-hoc guarantee like that in `std::vector`'s constructor. In fact, I think our original sin was probably not to add a `static_assert` in some of these methods so we started accepting types that we shouldn't have accepted, and then Hyrum's law materialized.

@asmok-g So in the end, the code will have to be fixed (and the fix is pretty trivial). However, our goal is not to make your life hard. If this breakage is very wide and challenging for you folks to fix, we can try to add a workaround on our side and give you a grace period. We're willing to work with you to make this as easy as possible, but the right thing to do in the end is to fix the code, not silently accept it.

Please let us know what the scope of breakage is and whether you want us to work on providing you a grace period.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149826



More information about the libcxx-commits mailing list