Skip to content

Commit 2ab0d44

Browse files
openpublishbuildColin Robertson
authored andcommitted
Resolve syncing conflicts from FromPublicMasterBranch to master (#408)
* Add build dir to gitignore * Update linker-tools-error-lnk2019.md * merging recent PRs into live (MicrosoftDocs#398) * Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (MicrosoftDocs#386) * Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (#387) * Update lambda-expressions-in-cpp.md * Update try-except-statement.md * Update try-except-statement.md Added some formatting fixes. * Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (#388) * Update lambda-expressions-in-cpp.md * Update try-except-statement.md * Update try-except-statement.md Added some formatting fixes. * removed duplicate F1 keywords and changed single quotes to doubles in F1 values * Update concurrency-namespace-operators-amp.md * fixed c-language inline topic to remove semicolon per user bug (MicrosoftDocs#391) * fixed c-language inline topic to remove semicolon per user bug * Update inline-functions.md Make it match the 2010 style, the only one that appears to be correct. * Confirm merge from FromPublicMasterBranch to master to sync with https://github.com/MicrosoftDocs/cpp-docs (branch master) (#389) * Update lambda-expressions-in-cpp.md * Update 2-7-2-6-reduction.md Fixed spacing and readability issues with reduction statement forms * Update try-except-statement.md * Update 2-7-2-6-reduction.md Added some extra formatting fixes. * Update try-except-statement.md Added some formatting fixes. * Fixed inconsistent reference to C++ language versions * Update std-specify-language-standard-version.md Additional wording for clarity. * Update definitions-and-declarations-cpp.md Fixed typing error * Changing Windows Store Apps to Windows 8.x Apps * Change ownership from Brian Peek * typo * chore: re-apply specific syntax inside block quote Because of commit 2ab53d3 (by @corob-msft), the specific syntax was broken ref: - MicrosoftDocs@2ab53d3#commitcomment-25117491 - https://github.com/MicrosoftDocs/cpp-docs/issues/114 - MicrosoftDocs#116 * Update linker-tools-error-lnk2019.md Expanded on the description to help in diagnosis and correction. * Add references to mbrtoc16/mbrtoc32/c16rtomb/c32rtomb to data conversion and multibyte interpretation function categories * Format functor class example
1 parent ca9ba50 commit 2ab0d44

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ A *function object*, or *functor*, is any type that implements operator(). This
2323
## Creating a Function Object
2424
To create a function object, create a type and implement operator(), such as:
2525

26+
```
2627
class Functor
27-
{
28-
public:
29-
int operator()(int a, int b)
30-
{
31-
return a <b;
32-
}
33-
};
34-
28+
{
29+
public:
30+
int operator()(int a, int b)
31+
{
32+
return a < b;
33+
}
34+
};
35+
```
36+
3537
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 is 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.
3638

3739
## Function Objects and Containers

0 commit comments

Comments
 (0)