神奇C++问题(7)
请问该段代码的输出结果.
#include <iostream>
#include <functional>
using namespace std;
template<class op>
void g(int size, op o, const char* sep = "") {
for(int i = 0; i < size; ++i)
cout << o(i) << sep;
}
template<class op,int size>
struct w {
char* operator()(int a) {
g(size,binder1st<op>(op(),a),"\t");
return "\n";
}
};
template<class op,int size>
void
x(){
g(size, w<op,size>());
}
int main(){
x<multiplies<int>,6>();
return 0;
}