I have an example functor deceleration as;
#include <iostream>
class myFunctorClass
{
public:
myFunctorClass (int x) : _x( x ) {}
int operator() (int y) { return _x + y; }
private:
int _x;
};
int main()
{
myFunctorClass addFive( 5 );
std::cout << addFive( 6 );
return 0;
}
My "What" is about the line just after the public:. I do not understand the syntax of the line myFunctorClass (int x) : _x( x ) {}
. What is doing and what another instance of the use of such syntax rule?