So apparently std::bind takes a bit of processing power/ time to do, so I figure I want to execute any binds at the start of a program, when I'm defining my classes and such, rather than do a lot of them during runtime.
Here's what I WANT to be able to do:
class House {
public:
float value;
protected:
void appreciate;
}
void House::appreciate(float increasedValue) {
value += increasedValue;
}
#include <vector>
class HousesManager {
public:
vector<House> houseList;
protected:
auto boundHousesAppreciateMethod; // Computationally expensive, so dont want to do it during runtime
void appreciateTheHouse;
}
HousesManager: HousesManager() {
boundHousesAppreciateMethod = std::bind<&House::appreciate, _____________>; // Bind during initialization
}
void HousesManager::appreciateTheHouse(House& theHouseInQuestion, float theAmount) {
theHouseInQuestion.boundHousesAppreciateMethod(theAmount); // Something like this
boundHousesAppreciateMethod(theHouseInQuestion, theAmount); // Or Like This
}
Please excuse the contrived nature of this example of Houses.. the point is that I need to be able to call a bound function on a specific instance of a class that's passed in as an parameter to another class method.