It is a C++11 syntax which covers typedef
functionality (and more).
In this case, it makes an alias called Fun
, which is the same type as an std::function<void()>
:
using Fun = std::function<void()>; // same as typedef std::function<void()> Fun
This means you can do this:
void foo()
{
std::cout << "foo\n";
}
Fun f = foo; // instead of std::function<void()> f = foo;
f();
Similarly for PFun
.