January 2018
Intermediate to advanced
374 pages
9h 53m
English
As mentioned before, every lambda function has its own type, even if they have the same signature (and even if they are identical).
The signature of a std::function is defined as follows:
std::function< return_type ( parameter0, parameter1...) >
So, a std::function returning nothing and having no parameters is defined like this...
auto func = std::function<void(void)>{};
A std::function returning a bool and having an int and a std::string as parameters is defined like this:
auto func = std::function<bool(int, std::string)>{};