1/*关于C++仿函数*/2#include<iostream>3#include<functional>4using namespace std;5using namespace std::placeholders;67template<typenameR1,typenameR2>8struct Calc9{10voidadd(R1a){11cout<<a<<endl;12};13voidadd_1(R1a,R1b){14cout<<a+b<<endl;15}16};1718intmain(int argc,char*args[]){192...
1/*关于C++仿函数*/2#include<iostream>3#include<functional>4usingnamespacestd;5usingnamespacestd::placeholders;67template <typename R1 , typename R2>8structCalc9{10voidadd(R1 a) {11cout << a <<endl;12};13voidadd_1(R1 a, R1 b) {14cout << a + b <<endl;15}16};1718intmain(intar...
5 using namespace std::placeholders; 6 7 template <typename R1 , typename R2> 8 struct Calc 9 { 10 void add(R1 a) { 11 cout << a << endl; 12 }; 13 void add_1(R1 a, R1 b) { 14 cout << a + b << endl; 15 } 16 }; 17 18 int main(int argc, char * args[]) {...