1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-localization
10 // UNSUPPORTED: c++03, c++11, c++14, c++17
12 // Val& operator*() const;
18 #include "test_macros.h"
21 template <class CharT
>
23 // operator* should return correct value
25 auto iss
= make_string_stream
<CharT
>("1 2 345 ");
26 std::ranges::basic_istream_view
<int, CharT
> isv
{iss
};
27 auto it
= isv
.begin();
28 std::same_as
<int&> decltype(auto) v1
= *it
;
32 // operator* should return the same reference to the value stored in the view
34 auto iss
= make_string_stream
<CharT
>("1 2 345 ");
35 std::ranges::basic_istream_view
<int, CharT
> isv
{iss
};
36 using Iter
= std::ranges::iterator_t
<decltype(isv
)>;
40 assert(&*it1
== &*it2
);
44 int main(int, char**) {
46 #ifndef TEST_HAS_NO_WIDE_CHARACTERS