Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2005-03-01 15:16:26

"Jonathan Turkanis" <technews_at_[hidden]> wrote

> Because the type expression passed to result_of must be of the form
> F(arg1, ..., argN).
> The correct way to use result_of with function pointers is as follows:

[original example snip]

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
    typedef boost::result_of<f()>::type result_type2;

IOW the args are 'sugar' in the function pointer/ref case.

Andy Little

Boost list run by bdawes at, gregod at, cpdaniel at, john at