
5 Mar
2007
5 Mar
'07
3:21 a.m.
shunsuke wrote:
Hi,
CVS HEAD can't compile this under maybe any conforming compiler. (RC_1_34 is ok.)
#include <boost/utility/result_of.hpp>
int my_fun(int) { return 0; }
template< class F > void test(F ) { typedef typename boost::result_of<F()>::type result_t; // shall be 'void'. }
int main() { ::test(&my_fun); }
Specializations are not enough?
I'm a bit confused. The type of F is int(*)(int). You're asking what the return type is if you call it with no parameters. But you can't do that! It takes an int. result_of<F(int)>::type compiles fine. I'm not sure this is a bug. Can you justify why you think this code should compile? -- Eric Niebler Boost Consulting www.boost-consulting.com