Skip to content

Commit 08ebd7d

Browse files
authored
Add backticks in "Function Objects in the C++ Standard Library" article
1 parent c423635 commit 08ebd7d

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
@@ -7,13 +7,13 @@ ms.assetid: 85f8a735-2c7b-4f10-9c4d-95c666ec4192
77
---
88
# Function Objects in the C++ Standard Library
99

10-
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.
10+
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

1212
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.
1313

1414
## Creating a Function Object
1515

16-
To create a function object, create a type and implement operator(), such as:
16+
To create a function object, create a type and implement `operator()`, such as:
1717

1818
```cpp
1919
class Functor
@@ -34,7 +34,7 @@ int main()
3434
}
3535
```
3636

37-
The last line of the `main` function shows how you call the function object. This call looks like a call to a function, but it's actually calling operator() of the Functor type. This similarity between calling a function object and a function is how the term function object came about.
37+
The last line of the `main` function shows how you call the function object. This call looks like a call to a function, but it's actually calling `operator()` of the `Functor` type. This similarity between calling a function object and a function is how the term function object came about.
3838

3939
## Function Objects and Containers
4040

0 commit comments

Comments
 (0)