games/bastet: unbreak with clang16 (C++17)

This commit is contained in:
naddy
2023-11-17 16:47:41 +00:00
parent 815af212be
commit b89509d7ae
@@ -0,0 +1,23 @@
std::bind2nd was removed in C++17
Index: BastetBlockChooser.cpp
--- BastetBlockChooser.cpp.orig
+++ BastetBlockChooser.cpp
@@ -115,7 +115,7 @@ namespace Bastet{
//otherwise, returns the pos-th block, where pos is random
static const boost::array<int,nBlockTypes> blockPercentages={{80, 92, 98, 100, 100, 100, 100}};
- int pos=find_if(blockPercentages.begin(),blockPercentages.end(),bind2nd(greater_equal<int>(),random()%100)) - blockPercentages.begin();
+ int pos=find_if(blockPercentages.begin(),blockPercentages.end(),bind(greater_equal<int>(),placeholders::_1,random()%100)) - blockPercentages.begin();
assert(pos>=0 && pos<nBlockTypes);
int chosenBlock=find(finalScores.begin(),finalScores.end(),temp[pos])-finalScores.begin();
@@ -211,7 +211,7 @@ namespace Bastet{
//returns the pos-th block, where pos is random
static const boost::array<int,nBlockTypes> blockPercentages={{80, 92, 98, 100, 100, 100, 100}};
- int pos=find_if(blockPercentages.begin(),blockPercentages.end(),bind2nd(greater_equal<int>(),random()%100)) - blockPercentages.begin();
+ int pos=find_if(blockPercentages.begin(),blockPercentages.end(),bind(greater_equal<int>(),placeholders::_1,random()%100)) - blockPercentages.begin();
assert(pos>=0 && pos<nBlockTypes);
int chosenBlock=find(finalScores.begin(),finalScores.end(),temp[pos])-finalScores.begin();