[libcxx-commits] [libcxx] Fix the LWG 3568 test for basic_istream_view (PR #215589)
Iskandar Emomzoda via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Aug 12 05:27:16 PDT 2026
================
@@ -39,10 +39,8 @@ void test() {
// LWG 3568. basic_istream_view needs to initialize value_
{
- auto iss = make_string_stream<CharT>("");
- std::ranges::basic_istream_view<int, CharT> isv{iss};
- auto iter = isv.begin();
- assert(*iter == 0);
+ static auto fn_local_iss = make_string_stream<CharT>("");
+ [[maybe_unused]] constexpr auto isv = std::views::istream<int>(fn_local_iss);
----------------
iskandarem wrote:
Do you mean something like this
```cpp
{
auto iss = std::stringstream("42");
std::ranges::basic_istream_view<NoopExtraction, CharT> isv{iss};
auto iter = isv.begin();
assert((*iter).n_ == 0);
return 0;
}
```
https://godbolt.org/z/zoWMszMTs
https://github.com/llvm/llvm-project/pull/215589
More information about the libcxx-commits
mailing list