I have a vector of unique_ptr of a class Tower. The unique_ptr is to stop object slicing for derived classes. I want to put the function drawTower on another thread. I've tried everything I could find but I keep getting this error: Error C2661 'std::tuple<void (__thiscall Tower::* )(sf::RenderWindow &,sf::Font,int &),_Ty *,sf::RenderWindow,sf::Font,int>::tuple': no overloaded function takes 5 arguments
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// Tower.h
class Tower {
void drawTower(sf::RenderWindow& wnd, sf::Font _font, int& gameMoney);
}
// main.cpp
int main() {
vector<unique_ptr<Tower>> towers;
thread t1;
for (int i = 0; i < towers.size(); i++) {
t1 = thread(&Tower::drawTower, &towers[i], window, f, money);
}
}