Skip to content

Commit 743d888

Browse files
TylerMSFTTylerMSFT
authored andcommitted
call out istream_view and wistream_view better
1 parent a9d77c0 commit 743d888

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

docs/standard-library/basic-istream-view-class.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
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++]", ]
77
dev_langs: ["C++"]
88
---
99
# `basic_istream_view` class (C++ Standard Library)
@@ -55,7 +55,7 @@ For a description of the following entries, see [View class characteristics](vie
5555
| **Common range** | No |
5656
| **Borrowed range** | No |
5757

58-
## Specializations
58+
## Specializations:`istream_view` and `wistream_view`
5959

6060
Convenience alias templates are provided for `char` and `wchar_t` streams, as follows:
6161

@@ -114,7 +114,9 @@ A `basic_istream_view` instance. The `basic_istream_view` internal stream pointe
114114
115115
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.
116116
117-
### Example: `basic_istream_view`
117+
### Example: `basic_istream_view`, `istream_view`, and `wistream_view`
118+
119+
```cpp
118120
119121
```cpp
120122
// requires /std:c++20 or later
@@ -152,7 +154,7 @@ int main()
152154
153155
// specify all template arguments
154156
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};
156158
for (const auto& elem : basic)
157159
{
158160
std::wcout << elem << ' '; // STL

docs/standard-library/iota-view-class.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "iota_view class (C++ Standard Library)| Microsoft Docs"
33
description: "API reference for the Standard Template Library (STL) <ranges> iota_view class: a factory that generates a view from a bounded or unbounded series of repeatedly incrementing values."
4-
ms.date: 10/14/2022
4+
ms.date: 11/04/2022
55
f1_keywords: ["ranges/std::iota_view", "ranges/std::iota_view::base", "ranges/std::iota_view::begin", "ranges/std::iota_view::end", "ranges/std::iota_view::size", "ranges/std::iota_view::empty", "ranges/std::iota_view::operator bool", "ranges/std::iota_view::back", "ranges/std::iota_view::front", "ranges/std::iota_view::operator[]"]
66
helpviewer_keywords: ["std::ranges::iota_view [C++]", "std::ranges::iota_view [C++], base", "std::ranges::iota_view [C++], begin", "std::ranges::iota_view [C++], end", "std::ranges::iota_view [C++], size", "std::ranges::iota_view [C++], empty", "std::ranges::iota_view [C++], operator bool", "std::ranges::iota_view [C++], front", "std::ranges::iota_view [C++], back", "std::ranges::iota_view [C++], operator[]"]
77
dev_langs: ["C++"]
@@ -124,13 +124,12 @@ int main()
124124
{
125125
std::ranges::iota_view<int> iv; // create an iota_view with an unbounded range, starting at 0
126126
std::ranges::iota_view<int> iv2(5); // create an iota_view with an unbounded range, starting at 5.
127-
std::ranges::iota_view<int, int> iv3{ 5, 10 }; // create an iota_view with a bounded range, starting at 5 and ending at 9
127+
std::ranges::iota_view<int, int> iv3{5, 10}; // create an iota_view with a bounded range, starting at 5 and ending at 9
128128
129129
std::vector<int> v{10, 20, 35, 45, 50, 66, 77, 82, 90, 100};
130130
auto start = std::ranges::find(v, 35);
131131
auto end = std::ranges::find(v, 82);
132-
auto iv4 = std::ranges::iota_view(start, end);
133-
for (auto &&val : iv4)
132+
for (auto &&val : std::ranges::iota_view(start, end))
134133
{
135134
std::cout << *val << ' '; // outputs 35 45 50 66 77
136135
}

docs/standard-library/view-classes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about view classes, which allow you to inexpensively refer to and transform ranges."
33
title: "View classes"
4-
ms.date: 10/07/2022
4+
ms.date: 11/04/2022
55
f1_keywords: ["RANGES/std::ranges::views", "RANGES/std::views"]
66
helpviewer_keywords: ["RANGES/VIEWS/std", "VIEWS/std"]
77
---
@@ -100,7 +100,7 @@ The following view classes are defined in the `std::ranges` namespace.
100100

101101
| View | Description |
102102
|--|--|
103-
| [`basic_istream_view`](basic-istream-view-class.md)<sup>C++20</sup> | A view of successive elements from an input stream. |
103+
| [`basic_istream_view`](basic-istream-view-class.md)<sup>C++20</sup> | A view of successive elements from an input stream. Includes `istream_view` and `wistream_view`. |
104104
| [`common_view`](common-view-class.md)<sup>C++20</sup> | Adapts a view that has different iterator/sentinel types into a view with the same iterator/sentinel types. |
105105
| [`drop_view`](drop-view-class.md)<sup>C++20</sup> | Created from another view, skipping the first `count` elements. |
106106
| [`drop_while_view`](drop-while-view-class.md)<sup>C++20</sup> | Created from another view, skipping leading elements as long as a predicate holds. |

0 commit comments

Comments
 (0)