RosettaCodeData/Task/Higher-order-functions/C++/higher-order-functions-1.cpp

22 lines
241 B
C++
Raw Permalink Normal View History

2013-06-05 21:47:54 +00:00
// Use <functional> for C++11
2013-04-10 21:29:02 -07:00
#include <tr1/functional>
#include <iostream>
using namespace std;
using namespace std::tr1;
void first(function<void()> f)
{
f();
}
void second()
{
cout << "second\n";
}
int main()
{
first(second);
}