[Qt-interest] Problems with template and function pointer

Sean Harmer sean.harmer at maps-technology.com
Thu Nov 4 14:33:46 CET 2010


On Thursday 04 November 2010 13:23:45 mario wrote:
> 2010/11/4  <qt at wachtler.de>:
> > p()
> 
> that was my first shot, but...
> 
>  error: must use ‘.*’ or ‘->*’ to call pointer-to-member function in
> ‘p (...)’, e.g. ‘(... ->* p) (...)’
> 
> at least in gcc 4.4.3

return ( *this.*m_function )();

where m_function is a function pointer. 

Or more generally if you have multiple possible objects on which to call a 
function:

return ( *m_object.*m_function )();

whre m_object is a pointer to the object.

HTH,

Sean




More information about the Qt-interest-old mailing list