Skip to content

Commit b07e312

Browse files
for_each_n added example notes about lambdas and c++17
1 parent b70cf0c commit b07e312

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎docs/standard-library/algorithm-functions.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2263,9 +2263,13 @@ otherwise the first element.
22632263

22642264
*`count`* must be non-negative, and there must be at least *`count`* elements in the range starting at *`first`*.
22652265

2266-
22672266
### Example
22682267

2268+
This example depicts a user-defined function object class, production code often
2269+
uses `[lambda](https://docs.microsoft.com/en-us/cpp/cpp/lambda-expressions-in-cpp?view=msvc-170)`s to achieve the same result with less code
2270+
2271+
Example requires `c++17`
2272+
22692273
```cpp
22702274
// alg_for_each_n.cpp
22712275
// compile with: /EHsc

0 commit comments

Comments
 (0)