Implement P2432R1 Fix istream_view#2245
Conversation
Drive-by: Drop extraneous `if constexpr` condition in `join_view::end` as suggested by cplusplus/draft#4957. Fixes microsoft#2240
| { // using ranges::basic_istream_view with wide stream | ||
| wistringstream wintstream{L"0 1 2 3"}; | ||
| T input_value[] = {-1, -1, -1, -1, -1}; | ||
| ranges::copy(basic_istream_view<T, wchar_t>{wintstream}, input_value); | ||
| assert(ranges::equal(input_value, expected)); | ||
| } | ||
|
|
||
| { // using ranges::basic_istream_view with narrow stream | ||
| istringstream intstream{"0 1 2 3"}; | ||
| T input_value[] = {-1, -1, -1, -1, -1}; | ||
| ranges::copy(basic_istream_view<T, char>{intstream}, input_value); | ||
| assert(ranges::equal(input_value, expected)); | ||
| } |
There was a problem hiding this comment.
Ultra nitpicks, no change requested: (1) I observe that these are wide-then-narrow while the following tests are ordered narrow-then-wide, and (2) I observe that these tests don't verify static_assert(noexcept) while the following tests do. (For the latter, there is no loss of coverage since istream_view and wistream_view are alias templates for basic_istream_view.)
This isn't significant enough to reset testing, just wanted to comment on something. 😹
There was a problem hiding this comment.
Ultra nitpicks, no change requested: (1) I observe that these are wide-then-narrow while the following tests are ordered narrow-then-wide, and (2) I observe that these tests don't verify
static_assert(noexcept)while the following tests do. (For the latter, there is no loss of coverage sinceistream_viewandwistream_vieware alias templates forbasic_istream_view.)This isn't significant enough to reset testing, just wanted to comment on something. 😹
I agree this just doesn't quite rise to the level of resetting testing. I'll keep the comment open just in case someone requests another change in which case I'll address this as well.
|
I'm mirroring this to an MSVC-internal PR; please notify me if any further changes are pushed. |
|
Thanks for traveling back in time to save the future! 🤖 ⏳ ✔️ |
Drive-by: Drop extraneous
if constexprcondition injoin_view::endas suggested by cplusplus/draft#4957.Fixes #2240