
1 Mar
2005
1 Mar
'05
8:27 p.m.
Andy Little wrote:
This also works :
#include <boost/static_assert.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/utility/result_of.hpp>
typedef int (*f)(int); // <-- no change
int main() { typedef boost::result_of<f(double,bool,long,char,int)>::type result_type1; typedef boost::result_of<f()>::type result_type2; BOOST_STATIC_ASSERT((boost::is_same<result_type1, result_type2>::value)); }
IOW the args are 'sugar' in the function pointer/ref case.
Hmmm ... interesting. That seems to be what TR1 says. Do you know why this is? A compile-time error would seem to be more useful in this case. Jonathan