Anonymous user
First-class functions: Difference between revisions
→{{header|C++}}
Line 332:
=={{header|C++}}==
{{works with|C++11}}
<lang cpp>
#include <
#include <vector>
#include <iostream>
Line 343:
using std::cout;
using std::endl;
using std
vector<double(*)(double)> A = {sin, cos, tan, [](double x) { return x*x*x; } };
Line 365:
auto identity = compose(log10, pow);
PRINT(identity(10, num));
return 0;
}
</lang>
|