Member Function Pointer not quite right

Posted by BlackDuck on Stack Overflow See other posts from Stack Overflow or by BlackDuck
Published on 2010-05-14T06:08:32Z Indexed on 2010/05/14 6:14 UTC
Read the original article Hit count: 188

Filed under:
|
|
|

I have a SpecialisedRedBlackTree class that is templated.

My Month class is not.

In my Month class I have a private member which is an instance of SpecialisedRedBlackTree:

SpecialisedRedBlackTree<Day> m_windSpeedTree;

As you can see it will take the Day class/object (please correct me on any terms I get wrong).

In my Month class, I have a method passing a method function pointer to this method:

bool Month::CompareWindSpeed(Day a, Day b) {
return ( a.GetData(WIND_SPEED_CODE) < b.GetData(WIND_SPEED_CODE)? true : false);
}

bool (Month::*myFuncPtr)(Day, Day);
myFuncPtr = &Month::CompareWindSpeed;
m_windSpeedTree.Insert(dayReading, myFuncPtr);

But because I am passing a bool (Day, Day) pointer to a templated class expecting bool (T, T)

T being part of this .... template

Error 1 error C2664: 'SpecialisedRedBlackTree<T>::Insert' : cannot convert parameter 2 from 'bool (__thiscall Month::* )(Day,Day)' to 'bool (__cdecl *)(T,T)'

Any advice?

© Stack Overflow or respective owner

Related posts about member

  • Oracle Coherence, Split-Brain and Recovery Protocols In Detail

    as seen on Oracle Blogs - Search for 'Oracle Blogs'
    This article provides a high level conceptual overview of Split-Brain scenarios in distributed systems. It will focus on a specific example of cluster communication failure and recovery in Oracle Coherence. This includes a discussion on the witness protocol (used to remove failed cluster members)… >>> More

  • MAMP + Python MySQLDB - trouble installing

    as seen on Server Fault - Search for 'Server Fault'
    I'm currently running the latest version of MAMP on my Snow Leopard OSX, and I'm trying to install MySQLDB. Downloaded: MySQL-python-1.2.3c1 I went into the setup_posix.py and adjusted the location of the mysql_config to the one in MAMP: mysql_config.path = "/Applications/MAMP/Library/bin/mysql_config" When… >>> More

  • Building Awesome WM

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    Hello, I am following these steps in order to build Awesome window manager on 10.04 I am building 3.4 while the tutorial is for 3.1 I installed all of the specified dependencies including cairo. After running cd awesome-3.4 && make I get the following missing dependencies error: Running… >>> More

  • Building Awesome WM

    as seen on Server Fault - Search for 'Server Fault'
    Hello, I am following these steps in order to build Awesome window manager on 10.04 I am building 3.4 while the tutorial is for 3.1 I installed all of the specified dependencies including cairo. EDIT I ran: sudo apt-get install libxcb-xtest0-dev libxcb-property1-dev libxdg-basedir-dev libstartup-notification0-dev… >>> More

  • Building Awesome WM

    as seen on Super User - Search for 'Super User'
    Hello, I am following these steps in order to build Awesome window manager on 10.04 I am building 3.4 while the tutorial is for 3.1 I installed all of the specified dependencies including cairo. EDIT I ran: sudo apt-get install libxcb-xtest0-dev libxcb-property1-dev libxdg-basedir-dev libstartup-notification0-dev… >>> More

Related posts about function