lundi 22 décembre 2014

C++ std::function template syntax

In C++11 you can instantiate std::function like this:



std::function<void(int)> f1;
std::function<int(std::string, std::string)> f2;
//and so on


But while there is plenty of info on variadic templates on the web, I fail to find any articles on how to write std::function-like template which would accept parenthesized arguments. Could anyone please explain the syntax and its limitations or at least point to an existing explanation?


Aucun commentaire:

Enregistrer un commentaire