Filip Konvi?ka ha escrito:
I've been playing with the problem too, and found this solution...it does not rely on typeof, but it does rely on return_type. I'm a bit unsure about why I had to use "unsigned int" to make it work, so I'd welcome some comments on this.
Do you mean you couldn't use RetType properly? I've tried with the following in GCC 3.2:
template
struct extract_and_call { typedef RetType result_type; RetType operator()(T const& t) const { return ((t .* MemberPtr) .* MemberFct)(); } }; Aye, I got the following warning that I could not get rid of (VC 7.1)
C:\Boost\include\boost-1_33_1\boost\functional\hash\hash.hpp(132) : warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data
[...]
Looks like an overzealous or simply misguided warning. Can you please
try the following?
#include