forked from Mirrors/openclonk
C4KeyboardInput: Replace std::bind2nd &c by lambda
std::ptr_fun and std::bind_2nd have been deprecated since C++11, and are no longer part of the standard since C++17.master
parent
907c701fc6
commit
1cd3534740
|
@ -690,16 +690,11 @@ void C4CustomKey::Update(const C4CustomKey *pByKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool C4KeyboardCallbackInterfaceHasOriginalKey(C4KeyboardCallbackInterface *pIntfc, const C4CustomKey *pCheckKey)
|
|
||||||
{
|
|
||||||
return pIntfc->IsOriginalKey(pCheckKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
void C4CustomKey::KillCallbacks(const C4CustomKey *pOfKey)
|
void C4CustomKey::KillCallbacks(const C4CustomKey *pOfKey)
|
||||||
{
|
{
|
||||||
// remove all instances from list
|
// remove all instances from list
|
||||||
CBVec::iterator i;
|
CBVec::iterator i;
|
||||||
while ((i = std::find_if(vecCallbacks.begin(), vecCallbacks.end(), std::bind2nd(std::ptr_fun(&C4KeyboardCallbackInterfaceHasOriginalKey), pOfKey))) != vecCallbacks.end())
|
while ((i = std::find_if(vecCallbacks.begin(), vecCallbacks.end(), [pOfKey](CBVec::value_type pIntfc) { return pIntfc->IsOriginalKey(pOfKey); })) != vecCallbacks.end())
|
||||||
{
|
{
|
||||||
C4KeyboardCallbackInterface *pItfc = *i;
|
C4KeyboardCallbackInterface *pItfc = *i;
|
||||||
vecCallbacks.erase(i);
|
vecCallbacks.erase(i);
|
||||||
|
|
Loading…
Reference in New Issue