Skip to content

Commit 4fc5411

Browse files
TylerMSFTTylerMSFT
authored andcommitted
acrolinx
1 parent 6dd32c2 commit 4fc5411

7 files changed

Lines changed: 21 additions & 21 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ inline constexpr empty_view<T> empty{};
8282
### Parameters
8383

8484
*`T`*\
85-
The type of the underlying element, of which there are none.
85+
The type of the underlying element, of which there is none.
8686

8787
### Remarks
8888

docs/standard-library/iterator-concepts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ helpviewer_keywords: ["std::ranges [C++], ranges::range", "std::ranges [C++], ra
77
---
88
# Iterator concepts
99

10-
Concepts are a C++20 language feature that constrain template parameters at compile time. They help prevent incorrect template instantiation, specify template argument requirements in a readable form, and provide more succinct template related compiler errors.
10+
Concepts are a C++20 language feature that constrains template parameters at compile time. They help prevent incorrect template instantiation, specify template argument requirements in a readable form, and provide more succinct template related compiler errors.
1111

1212
Consider the following example, which defines a concept to prevent instantiating a template with a type that doesn't support division:
1313

@@ -52,7 +52,7 @@ When you pass the compiler switch `/diagnostics:caret` to Visual Studio 2022 ver
5252

5353
Iterator concepts are defined in the `std` namespace as declared in the `<iterator>` header file. They're used in the declarations of [range adaptors](range-adaptors.md), [views](view-classes.md), and so on.
5454

55-
There are six categories of iterators. They are directly related to the categories of ranges listed under [Range concepts](ranges.md#range-concepts).
55+
There are six categories of iterators. They're directly related to the categories of ranges listed under [Range concepts](ranges.md#range-concepts).
5656

5757
The following iterator concepts are listed in order of increasing capability. `input_or_output_iterator` is at the low end of the capability hierarchy, and `contiguous_iterator` is at the high end. Iterators higher in the hierarchy can generally be used in place of those that are lower, but not vice-versa. For example, a `random_access_iterator` iterator can be used in place of a `forward_iterator`, but not the other way around. An exception is `input_iterator`, which can't be used in place of `output_iterator` because it can't write.
5858

@@ -411,7 +411,7 @@ The type to test to see if it's a sentinel for `I`.
411411
412412
### Remarks
413413
414-
A sentinel is a type that can be compared to an iterator to determine if the iterator has reached the end. This concept determines if a type is a sentinel for one of the `input_or_output_iterator` types which includes `input_iterator`, `output_iterator`, `forward_iterator`, `bidirectional_iterator`, `random_access_iterator`, and `contiguous_iterator`.
414+
A sentinel is a type that can be compared to an iterator to determine if the iterator has reached the end. This concept determines if a type is a sentinel for one of the `input_or_output_iterator` types, which includes `input_iterator`, `output_iterator`, `forward_iterator`, `bidirectional_iterator`, `random_access_iterator`, and `contiguous_iterator`.
415415
416416
### Example: `sentinel_for`
417417

docs/standard-library/iterator-functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ int main()
236236
160 106 80 70 53 40 35 23 20 16 10 8 5 4 2 1
237237
```
238238

239-
The function `reverse_sort` supports containers of any kind, in addition to regular arrays, because it calls the non-member version of `begin()`. If `reverse_sort` were coded to use the container member `begin()`:
239+
The function `reverse_sort` supports containers of any kind, in addition to regular arrays, because it calls the non-member version of `begin()`. Coding `reverse_sort` to use the container member `begin()`:
240240

241241
```cpp
242242
template <typename C>
@@ -249,7 +249,7 @@ void reverse_sort(C& c) {
249249
}
250250
```
251251
252-
Then sending an array to it would cause this compiler error:
252+
Then sending an array to it, causes this compiler error:
253253
254254
```Output
255255
error C2228: left of '.begin' must have class/struct/union
@@ -1031,7 +1031,7 @@ The template function returns `next` decremented `off` times.
10311031

10321032
## <a name="rbegin"></a> `rbegin`
10331033

1034-
Get an iterator which returns the elements of the container in reverse order.
1034+
Get an iterator, which returns the elements of the container in reverse order.
10351035

10361036
```cpp
10371037
template <class C> constexpr auto rbegin(C& c) -> decltype(c.rbegin());

docs/standard-library/iterator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Defines predefined iterators and stream iterators, iterator primitives, and supp
1919

2020
Iterators are a generalization of pointers that allow a C++ program to work with different data structures in a uniform way. Instead of operating on specific data types, algorithms operate on a range of values as specified by a kind of iterator. Algorithms can operate on any data structure that satisfies the requirements of the iterator.
2121

22-
In C++20, there are 6 categories of iterators. Iterators are arranged in a hierarchy of capability. Their capabilities are specified by C++20 concepts. For a description of the various iterators and their capabilities, see [Iterator concepts](iterator-concepts.md)
22+
In C++20, there are six categories of iterators. Iterators are arranged in a hierarchy of capability. Their capabilities are specified by C++20 concepts. For a description of the various iterators and their capabilities, see [Iterator concepts](iterator-concepts.md)
2323

2424
Visual Studio has added extensions to C++ Standard Library iterators to support debugging for checked and unchecked iterators. For more information, see [Safe Libraries: C++ Standard Library](../standard-library/safe-libraries-cpp-standard-library.md).
2525

docs/standard-library/range-adaptors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ When a range adaptor produces a view, it doesn't incur the cost of transforming
5050

5151
Creating a view is preparation to do work in the future. In the previous example, creating the view doesn't result in finding all the elements divisible by three or squaring those elements. Work happens only when you access an element in the view.
5252

53-
Elements of a view are usually the actual elements of the range used to create the view. The view usually doesn't own the elements; it just refers to them. Although ([`owning_view`](owning-view-class.md) is an exception. Changing an element changes that element in the range that the view was created from. The following example shows this behavior:
53+
Elements of a view are usually the actual elements of the range used to create the view. The view usually doesn't own the elements; it just refers to them. Although [`owning_view`](owning-view-class.md) is an exception. Changing an element changes that element in the range that the view was created from. The following example shows this behavior:
5454

5555
```cpp
5656
#include <algorithm>

docs/standard-library/range-concepts.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ helpviewer_keywords: ["std::ranges [C++], ranges::range", "std::ranges [C++], ra
77
---
88
# `<ranges>` concepts
99

10-
Concepts are a C++20 language feature that constrain template parameters at compile time. They help prevent incorrect template instantiation, specify template argument requirements in a readable form, and provide more succinct template related compiler errors.
10+
Concepts are a C++20 language feature that constrains template parameters at compile time. They help prevent incorrect template instantiation, specify template argument requirements in a readable form, and provide more succinct template related compiler errors.
1111

1212
Consider the following example, which defines a concept to prevent instantiating a template with a type that doesn't support division:
1313

@@ -52,7 +52,7 @@ When you pass the compiler switch `/diagnostics:caret` to Visual Studio 2022 ver
5252

5353
Range concepts are defined in the `std::ranges` namespace as declared in the `<ranges>` header file. They're used in the declarations of [range adaptors](range-adaptors.md), [views](view-classes.md), and so on.
5454

55-
There are six categories of ranges. They are related to the categories of iterators listed in [`<iterator>` concepts](iterator-concepts.md). In order of increasing capability, the categories are:
55+
There are six categories of ranges. They're related to the categories of iterators listed in [`<iterator>` concepts](iterator-concepts.md). In order of increasing capability, the categories are:
5656

5757
| Range concept | Description |
5858
|--|--|
@@ -63,7 +63,7 @@ There are six categories of ranges. They are related to the categories of iterat
6363
| [`random_access_range`](#random_access_range) | Specifies a range that can read and write by index. |
6464
| [`contiguous_range`](#contiguous_range) | Specifies a range whose elements are sequential in memory and can be accessed using pointer arithmetic. |
6565

66-
In the preceding table, concepts are listed in order of increasing capability. A range that meets the requirements of a concept generally meets the requirements of the concepts in the rows that precede it. For example, a `random_access_range` has the capability of a `bidirectional_range`, `forward_range`, `input_range`, and `output_range`. However, an exception is `input_range` which doesn't have the capability of an `output_range` because it can't be written to.
66+
In the preceding table, concepts are listed in order of increasing capability. A range that meets the requirements of a concept generally meets the requirements of the concepts in the rows that precede it. For example, a `random_access_range` has the capability of a `bidirectional_range`, `forward_range`, `input_range`, and `output_range`. Except `input_range`, which doesn't have the capability of an `output_range` because it can't be written to.
6767

6868
Other range concepts include:
6969

@@ -94,7 +94,7 @@ The type to test to see if it's a `bidirectional_range`.
9494

9595
### Remarks
9696

97-
This kind of range supports [`bidirectional_iterator`](iterator-concepts.md#bidirectional_iterator) or above.
97+
This kind of range supports [`bidirectional_iterator`](iterator-concepts.md#bidirectional_iterator) or greater.
9898
A `bidirectional_iterator` has the capabilities of a `forward_iterator`, but can also iterate backwards.
9999

100100
Some examples of a `bidirectional_range` are `std::set`, `std::vector`, and `std::list`.
@@ -154,7 +154,7 @@ The type to test to see if it's a `contiguous_range`.
154154
155155
### Remarks
156156
157-
A `contiguous_range` can be accessed by pointer arithmetic because the elements are laid out sequentially in memory and are the same size. This kind of range supports [`continguous_iterator`](iterator-concepts.md#contiguous_iterator) which is the most flexible of all the iterators.
157+
A `contiguous_range` can be accessed by pointer arithmetic because the elements are laid out sequentially in memory and are the same size. This kind of range supports [`continguous_iterator`](iterator-concepts.md#contiguous_iterator), which is the most flexible of all the iterators.
158158
159159
Some examples of a `contiguous_range` are `std::array`, `std::vector`, and `std::string`.
160160
@@ -202,7 +202,7 @@ The type to test to see if it's a `forward_range`.
202202

203203
### Remarks
204204

205-
This kind of range supports [`forward_iterator`](iterator-concepts.md#forward_iterator) or above. A `forward_iterator` can iterate over a range multiple times.
205+
This kind of range supports [`forward_iterator`](iterator-concepts.md#forward_iterator) or greater. A `forward_iterator` can iterate over a range multiple times.
206206

207207
## `input_range`
208208

@@ -225,7 +225,7 @@ When a type meets the requirements of `input_range`:
225225
- The `ranges::begin()` function returns an `input_iterator`. Calling `begin()` more than once on an `input_range` results in undefined behavior.
226226
- You can dereference an `input_iterator` repeatedly, which yields the same value each time. An `input_range` isn't multi-pass. Incrementing an iterator invalidates any copies.
227227
- It can be used with `ranges::for_each`.
228-
- It supports [`input_iterator`](iterator-concepts.md#input_iterator) or above.
228+
- It supports [`input_iterator`](iterator-concepts.md#input_iterator) or greater.
229229

230230
## `output_range`
231231

@@ -246,7 +246,7 @@ The type of the data to write to the range.
246246
247247
### Remarks
248248
249-
The meaning of `output_iterator<iterator_t<R>, T>` is that the type provides an iterator that can write values of type `T` to a range of type `R`. In other words, it supports [`output_iterator`](iterator-concepts.md#output_iterator) or above.
249+
The meaning of `output_iterator<iterator_t<R>, T>` is that the type provides an iterator that can write values of type `T` to a range of type `R`. In other words, it supports [`output_iterator`](iterator-concepts.md#output_iterator) or greater.
250250
251251
## `random_access_range`
252252
@@ -265,7 +265,7 @@ The type to test to see if it's a `sized_range`.
265265

266266
### Remarks
267267

268-
This kind of range supports [`random_access_iterator`](iterator-concepts.md#random_access_iterator) or above. A `random_access_range` has the capabilities of an `input_range`, `output_range`, `forward_range`, and `bidirectional_range`. A `random_access_range` is sortable.
268+
This kind of range supports [`random_access_iterator`](iterator-concepts.md#random_access_iterator) or greater. A `random_access_range` has the capabilities of an `input_range`, `output_range`, `forward_range`, and `bidirectional_range`. A `random_access_range` is sortable.
269269

270270
Some examples of a `random_access_range` are `std::vector`, `std::array`, and `std::deque`.
271271

docs/standard-library/view-classes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ helpviewer_keywords: ["RANGES/VIEWS/std", "VIEWS/std"]
77
---
88
# View classes
99

10-
A *view* is a lightweight range that refers to elements that it doesn't own (with the exception of [`owning_view`](owning-view-class.md)). A view is typically based on another range and provides a different way of looking at it, whether by transforming or filtering it. For example, [`std::views::filter`](filter-view-class.md) is a view that uses the criteria that you specify to select elements from another range.
10+
A *view* is a lightweight range that refers to elements that it doesn't own (except [`owning_view`](owning-view-class.md)). A view is typically based on another range and provides a different way of looking at it, whether by transforming or filtering it. For example, [`std::views::filter`](filter-view-class.md) is a view that uses the criteria that you specify to select elements from another range.
1111

1212
When you access the elements in a view, it's done "lazily" so that work is done only when you get an element. This makes it possible to combine, or *compose*, views without a performance penalty.
1313

@@ -157,9 +157,9 @@ In the **Characteristics** section of each view class topic, the iterator catego
157157
| [`random_access_range`](range-concepts.md#random_access_range) | Can access the collection with an index; multi-pass. |
158158
| [`contiguous_range`](range-concepts.md#contiguous_range) | Can access the collection with an index, and elements are stored contiguously in memory. |
159159

160-
Generally speaking, an iterator has the capability of the iterators that precede it in the table. For example, [`bidirectional_range`](range-concepts.md#bidirectional_range) has the capabilities of [`forward_range`](range-concepts.md#forward_range), but not vice versa. An exception is `input_range` which doesn't have the capability of `output_range` because you can't write to an `input_range`.
160+
Generally speaking, an iterator has the capability of the iterators that precede it in the table. For example, [`bidirectional_range`](range-concepts.md#bidirectional_range) has the capabilities of [`forward_range`](range-concepts.md#forward_range), but not vice versa. Except `input_range`, which doesn't have the capability of `output_range` because you can't write to an `input_range`.
161161

162-
The statement "requires `input_range` or higher" means that the view can be used with an `input_range`, `forward_range`, `bidirectional_range`, `random_access_range`, or `contiguous_range` iterator, because they are all as capable as `input_range`.
162+
The statement "requires `input_range` or higher" means that the view can be used with an `input_range`, `forward_range`, `bidirectional_range`, `random_access_range`, or `contiguous_range` iterator, because they're all as capable as `input_range`.
163163

164164
The ranges iterator hierarchy is directly related to the iterator hierarchy. For more information, see [Iterator concepts](iterator-concepts.md).
165165

0 commit comments

Comments
 (0)