Skip to content

Commit f9fb8ef

Browse files
authored
Tighten wording in "Function Objects in the C++ Standard Library" article
1 parent 08ebd7d commit f9fb8ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/standard-library/function-objects-in-the-stl.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.assetid: 85f8a735-2c7b-4f10-9c4d-95c666ec4192
99

1010
A *function object*, or *functor*, is any type that implements `operator()`. This operator is referred to as the *call operator* or sometimes the *application operator*. The C++ Standard Library uses function objects primarily as sorting criteria for containers and in algorithms.
1111

12-
Function objects provide two main advantages over a straight function call. The first is that a function object can contain state. The second is that a function object is a type and therefore can be used as a template parameter.
12+
Function objects provide two main advantages over a regular function call. The first is that a function object can contain state. The second is that a function object is a type and therefore can be used as a template parameter.
1313

1414
## Creating a Function Object
1515

@@ -51,7 +51,7 @@ The second template argument is the function object `less`. This function object
5151
5252
## Function Objects and Algorithms
5353
54-
Another use of functional objects is in algorithms. For example, the `remove_if` algorithm is declared as follows:
54+
Another use of function objects is in algorithms. For example, the `remove_if` algorithm is declared as follows:
5555
5656
```cpp
5757
template <class ForwardIterator, class Predicate>
@@ -61,7 +61,7 @@ ForwardIterator remove_if(
6161
Predicate pred);
6262
```
6363

64-
The last argument to `remove_if` is a function object that returns a boolean value (a *predicate*). If the result of the function object is **`true`**, then the element is removed from the container being accessed by the iterators `first` and `last`. You can use any of the function objects declared in the [`<functional>`](../standard-library/functional.md) header for the argument `pred` or you can create your own.
64+
The last argument to `remove_if` is a function object that returns a boolean value (a *predicate*). If the result of the function object is **`true`**, then the element is shifted such that it's beyond the new end returned by `remove_if`. You can use any of the function objects declared in the [`<functional>`](../standard-library/functional.md) header for the argument `pred` or you can create your own.
6565

6666
## See also
6767

0 commit comments

Comments
 (0)