So I have a string vector values but I want to convert this vector into a vector of type Game, which is my own custom class. How would I go about this?
I'm trying something like this:
void set_games(vector <string> values){
vector <Game> tmp(values.begin(), values.end());
games = tmp;
}
but it's not working. Any suggestions?
Current error message:
no matching function for call to ‘Game::Game(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)’
./classes/game.h:12: note: candidates are: Game::Game()
./classes/game.h:9: note: Game::Game(const Game&)
Update:
Added Game constructor parameter. Everything working as expected.
std::transform()?