Tutorial by Examples

Function pointers are the most basic way of passing functions around, which can also be used in C. (See the C documentation for more details). For the purpose of callable objects, a function pointer can be defined as: typedef returnType(*name)(arguments); // All using name =...
Every class which overloads the operator() can be used as a function object. These classes can be written by hand (often referred to as functors) or automatically generated by the compiler by writing Lambdas from C++11 on. struct Person { std::string name; unsigned int age; }; // Func...

Page 1 of 1