Skip to content

Commit bb4d0b7

Browse files
author
Colin Robertson
authored
Merge pull request #3595 from MicrosoftDocs/FromPublicMasterBranch
Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master)
2 parents 1a859cc + ad8ac11 commit bb4d0b7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/cpp/lambda-expression-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This article demonstrates the syntax and structural elements of lambda expressio
1313

1414
When you write code, you probably use function pointers and function objects to solve problems and perform calculations, especially when you use [C++ Standard Library algorithms](../standard-library/algorithms.md). Function pointers and function objects each have advantages and disadvantages—for example, function pointers have minimal syntactic overhead but do not retain state within a scope, and function objects can maintain state but require the syntactic overhead of a class definition.
1515

16-
A lambda combines the benefits of function pointers and function objects and avoids their disadvantages. Like a function objects, a lambda is flexible and can maintain state, but unlike a function object, its compact syntax doesn't require an explicit class definition. By using lambdas, you can write code that's less cumbersome and less prone to errors than the code for an equivalent function object.
16+
A lambda combines the benefits of function pointers and function objects and avoids their disadvantages. Like a function object, a lambda is flexible and can maintain state, but unlike a function object, its compact syntax doesn't require an explicit class definition. By using lambdas, you can write code that's less cumbersome and less prone to errors than the code for an equivalent function object.
1717

1818
The following examples compare the use of a lambda to the use of a function object. The first example uses a lambda to print to the console whether each element in a `vector` object is even or odd. The second example uses a function object to accomplish the same task.
1919

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4103.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following sample generates C4103:
2020
// C4103.h
2121
#pragma pack(push, 4)
2222

23-
// defintions and declarations
23+
// definitions and declarations
2424

2525
// uncomment the following line to resolve
2626
// #pragma pack(pop)

docs/standard-library/algorithm-functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9445,7 +9445,7 @@ int main()
94459445
v1_NewEnd3 = unique ( v1.begin( ), v1_NewEnd2, greater<int>( ) );
94469446

94479447
cout << "Removing adjacent elements satisfying the binary\n "
9448-
<< " predicate mod_equal from vector v1 gives ( " ;
9448+
<< " predicate greater<int> from vector v1 gives ( " ;
94499449
for ( v1_Iter3 = v1.begin( ) ; v1_Iter3 != v1_NewEnd3 ; v1_Iter3++ )
94509450
cout << *v1_Iter3 << " ";
94519451
cout << ")." << endl;
@@ -9460,7 +9460,7 @@ Removing adjacent duplicates from vector v1 under the
94609460
binary predicate mod_equal gives
94619461
( 5 4 7 ).
94629462
Removing adjacent elements satisfying the binary
9463-
predicate mod_equal from vector v1 gives ( 5 7 ).
9463+
predicate greater<int> from vector v1 gives ( 5 7 ).
94649464
```
94659465

94669466
## <a name="unique_copy"></a> `unique_copy`

0 commit comments

Comments
 (0)