Skip to content

Commit debc758

Browse files
TylerMSFTTylerMSFT
authored andcommitted
little fix
1 parent 8445fa7 commit debc758

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/standard-library/view-classes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ 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, except for [`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 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 for [`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 you specify to select elements from another range.
1111

12-
When you access the elements in a view, it's done 'lazily' so that work is only done when you get an element. This also makes it possible to combine, or 'compose' views without a performance penalty. For example, you could create a view that provides only the even elements from a range, and then transform them by squaring them. The work to do the filtering and transformation is done only for the elements you access, and only when you access them.
12+
When you access the elements in a view, it's done 'lazily' so that work is only done when you get an element. This also makes it possible to combine, or 'compose' views without a performance penalty. For example, you could create a view that provides only the even elements from a range and then transform them by squaring them. The work to do the filtering and transformation is done only for the elements you access, and only when you access them.
1313

1414
A view can be copied, assigned, and destroyed in constant time no matter how many elements it contains. This is because a view doesn't own the elements it refers to, so it doesn't need to make a copy. This is also why you can compose views without a performance penalty.
1515

0 commit comments

Comments
 (0)