|
Boost : |
From: Andy Little (andy_at_[hidden])
Date: 2005-03-01 02:27:31
"Jonathan Turkanis" <technews_at_[hidden]> wrote in message
news:cvvvpc$ipt$1_at_sea.gmane.org...
> Andy Little wrote:
>> "Tobias Schwinger" <tschwinger_at_[hidden]> wrote
>>
>>> It shows me that I have to write more tests/examples, very soon...
>>
>>> From what I have seen its very cool. :-)
>>
>> How does this play with boost::result_of. Is there any potential to
>> extend result_of by this?
>
> result_of should already get the right answers for these types.
#include <iostream>
#include "boost/utility/result_of.hpp" // v 1.32.0
// BTW following requires #include
"boost/function_types/function_type_parameter.hpp"
#include "boost/function_types/function_type_result.hpp"
typedef int f(int);
int main()
{
// fails (Vc7.1, gcc3.2)
// typedef boost::result_of<f>::type result_type;
//succeeds(Vc7.1, gcc3.2)
typedef boost::function_types::function_type_result<
f
>::type result_type;
std::cout << typeid(result_type).name() <<'\n';
}
regards
Andy Little
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk