From 5cb9c087d0fe125bd285d70ba7dc6a3bcd65f1c7 Mon Sep 17 00:00:00 2001 From: Konstantin Batkov Date: Fri, 2 Oct 2020 17:32:43 +0200 Subject: [PATCH] minor typo corrected The above example -> the example below --- analysis/newf2/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analysis/newf2/intro.md b/analysis/newf2/intro.md index b72197e..661f15f 100644 --- a/analysis/newf2/intro.md +++ b/analysis/newf2/intro.md @@ -226,7 +226,7 @@ private: }; ``` -The above code snippet defines a `functor`. There are a couple of nice things about functors. One is that unlike regular functions, they can contain a *state*. The above example creates a function which adds 42 to whatever you give it. But that value 42 is not hardcoded, it was specified as a constructor argument when we created our functor instance. You could create another adder, which added 27, just by calling the constructor with a different value. This makes them nicely customizable. +The above code snippet defines a `functor`. There are a couple of nice things about functors. One is that unlike regular functions, they can contain a *state*. The example below creates a function which adds 42 to whatever you give it. But that value 42 is not hardcoded, it was specified as a constructor argument when we created our functor instance. You could create another adder, which added 27, just by calling the constructor with a different value. This makes them nicely customizable. ```cpp // Now you can use it like this: