// wrapped0.cpp -- using a function wrapper #include "somedefs.h" #include #include #include double dub(double x) {return 2.0*x;} int main() { using std::cout; using std::endl; using std::function; typedef function fdd; double y = 1.21; function ef1 = dub; function ef2 = std::sqrt; function ef3 = Fq(10.0); function ef4 = Fp(10.0); function ef5 = [](double u) {return u*u;}; function ef6 = [](double u) {return u+u/2.0;}; cout << use_f(y, function(dub)) << endl; cout << use_f(y, fdd(sqrt)) << endl; cout << use_f(y, ef3) << endl; cout << use_f(y, ef4) << endl; cout << use_f(y, ef5) << endl; cout << use_f(y, ef6) << endl; std::cin.get(); return 0; }