Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-03-01 15:27:34


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk