|
1 | 1 | --- |
2 | 2 | title: "basic_istream_view class (C++ Standard Library)| Microsoft Docs" |
3 | | -description: "API reference for the Standard Template Library (STL) <ranges> basic_istream_view class, which reads (using operator>>) successive elements from an input stream." |
4 | | -ms.date: 09/27/2022 |
5 | | -f1_keywords: ["ranges/std::basic_istream_view", "ranges/std::basic_istream_view::base", "ranges/std::basic_istream_view::begin", "ranges/std::basic_istream_view::data", "ranges/std::basic_istream_view::empty", "ranges/std::basic_istream_view::end", "ranges/std::basic_istream_view::size", "ranges/std::basic_istream_view::operator bool", "ranges/std::basic_istream_view::back", "ranges/std::basic_istream_view::front", "ranges/std::basic_istream_view::operator[]"] |
6 | | -helpviewer_keywords: ["std::ranges::basic_istream_view [C++]", "std::ranges::basic_istream_view::base [C++]", "std::ranges::basic_istream_view::begin [C++]", "std::ranges::basic_istream_view::data [C++]", "std::ranges::basic_istream_view::empty [C++]", "std::ranges::basic_istream_view::end [C++]", "std::ranges::basic_istream_view::size [C++]", "std::ranges::basic_istream_view::back [C++]", "std::ranges::basic_istream_view::front [C++]", "std::ranges::basic_istream_view::operator[] [C++]", "std::ranges::basic_istream_view::operator bool [C++]"] |
| 3 | +description: "API reference for the Standard Template Library (STL) <ranges> basic_istream_view class, which reads (using operator>>) successive elements from an input stream. Also includes the istream_view and wistream_view specializations." |
| 4 | +ms.date: 11/04/2022 |
| 5 | +f1_keywords: ["ranges/std::basic_istream_view", "ranges/std::istream_view", "ranges/std::wistream_view", "ranges/std::basic_istream_view::begin", "ranges/std::basic_istream_view::end", "ranges/std::istream_view::begin", "ranges/std::istream_view::end", "ranges/std::wistream_view::begin", "ranges/std::wistream_view::end"] |
| 6 | +helpviewer_keywords: ["std::ranges::basic_istream_view [C++]", "std::ranges::istream_view [C++]", "std::ranges::wistream_view [C++]", "std::ranges::basic_istream_view::base [C++]", "std::ranges::basic_istream_view::begin [C++]", "std::ranges::basic_istream_view::end [C++]", ] |
7 | 7 | dev_langs: ["C++"] |
8 | 8 | --- |
9 | 9 | # `basic_istream_view` class (C++ Standard Library) |
@@ -55,7 +55,7 @@ For a description of the following entries, see [View class characteristics](vie |
55 | 55 | | **Common range** | No | |
56 | 56 | | **Borrowed range** | No | |
57 | 57 |
|
58 | | -## Specializations |
| 58 | +## Specializations:`istream_view` and `wistream_view` |
59 | 59 |
|
60 | 60 | Convenience alias templates are provided for `char` and `wchar_t` streams, as follows: |
61 | 61 |
|
@@ -114,7 +114,9 @@ A `basic_istream_view` instance. The `basic_istream_view` internal stream pointe |
114 | 114 |
|
115 | 115 | The best way to create a `basic_istream_view` is by using the [`views::istream`](range-adaptors.md#istream) range adaptor. Range adaptors are the intended way to create view classes. The view types are exposed in case you want to create your own custom view type. |
116 | 116 |
|
117 | | -### Example: `basic_istream_view` |
| 117 | +### Example: `basic_istream_view`, `istream_view`, and `wistream_view` |
| 118 | +
|
| 119 | +```cpp |
118 | 120 |
|
119 | 121 | ```cpp |
120 | 122 | // requires /std:c++20 or later |
@@ -152,7 +154,7 @@ int main() |
152 | 154 |
|
153 | 155 | // specify all template arguments |
154 | 156 | std::wistringstream misc(L"S T L"); |
155 | | - std::ranges::basic_istream_view<wchar_t, wchar_t, std::char_traits<wchar_t>> basic{ misc }; |
| 157 | + std::ranges::basic_istream_view<wchar_t, wchar_t, std::char_traits<wchar_t>> basic{misc}; |
156 | 158 | for (const auto& elem : basic) |
157 | 159 | { |
158 | 160 | std::wcout << elem << ' '; // STL |
|
0 commit comments