|
Boost Users : |
From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2007-09-28 12:55:31
Martin Ecker wrote:
> Hello,
>
> I'm running into a problem when using boost::result_of with gcc 3.4.2
> and 4.2.1 (with MingW).
>
> The following program compiles fine with Visual C++ 8.0, but not with gcc:
>
<snip code>
> I get the same error if I simply wrap test_function1 in another
> template class as nested struct and then use it instead of test_function2.
>
> Am I attempting to do something fundamentally wrong here, or is it a
> bug in gcc?
It's a compiler bug fixed with GCC 4.2.2.
But it's often a good idea to deduce the function object's type
(especially in case operator() is const qualified):
template< class Self, typename T >
struct result< Self(T) >
...
Regards,
Tobias
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net