The contiguous range made incorrect assumptions for certain input
ranges.
Fixes llvm.org/PR60164
Differential D142302
[libc++][format] Fixes usage of contiguous ranges. Mordante on Jan 22 2023, 4:34 AM. Authored by
Details
The contiguous range made incorrect assumptions for certain input Fixes llvm.org/PR60164
Diff Detail
Unit Tests Event TimelineComment Actions We have iterators of all categories (and sized/unsized sentinels) in test_iterators.h. Why don't you use them?
Comment Actions Thanks for the reviews! In the tests for sets and maps @ldionne suggested to use adaptor classes with a minimal interface in the tests. So I thought it would be good to do the same here. I already use some the test iterators, just prior to the new hunk.
Comment Actions Thanks for the feedback!
|
How about using ranges::distance (http://eel.is/c++draft/range.iter.op.distance#4) here instead of ranges::size? We could get rid of ranges::sized_range<_Rp> constraint.
Also, I think we need extra includes: <__ranges/data.h> and <__ranges/size.h> (or <__iterator/distance.h>).