I wonder how can we implement a result_of template class to get the return type of a function.
I know C++11 has std::result_of or decltype. But how the boost implement this feature in C++98 standard?
I have tried to learn from source code, but I didn't get the point.
It should be like this:
int fint() { return 0;}
double fdouble() { return double(0);}
cout << sizeof(result_of<fint>::type) << endl; // should be 4
cout << sizeof(result_of<fdouble>::type) << endl; // should be 8
result_of<fint>::type x; // same as `int x;`
result_of<fdouble>::type y; // same as `double y;`