I am getting the following errors:
- '<': illegal, left operand has type 'const_Ty'
- '>: illegal, right operand has type 'const_Ty'
in the below code.
It's a relative simple iterator on a function pointer map where the functions are of the form void (Game::*)(UINT)
. I check the value against a float, then run the function.
The problem seems to be in the for
line, although I've got another substantially similar for loop somewhere else that works without a problem.
using FuncPtr = void (Game::*)(UINT);
std::map<FuncPtr, float> funcDelayedTriggerMap;
void Game::PollProcessDelayedTriggers()
{
for (std::map<FuncPtr, float>::iterator it = funcDelayedTriggerMap.begin(); it != funcDelayedTriggerMap.end(); ++it)
{
float currentS = m_timer.GetElapsedSeconds();
if (it->second < currentS)
{
(this->*(it->first))(UINT_MAX);
funcDelayedTriggerMap.erase(it->first);
}
}
}