I am busy programming a card game. For this card game, I want to shuffle the deck. The deck is a list of unique pointers and looks something like this:
std::list<std::unique_ptr<Cards>> _deck;
I tried to get a random sequence with the shuffle function from but I got the following error: "No instance of function template "std::shuffle" matches the argument list".". View the code block below for the arguments.
std::shuffle(_buildings_deck.begin(), _buildings_deck.back(), std::default_random_engine{});
As far as I can see the arguments that I am using are correct, I still need to choose a random engine but that should not be the problem. So I got to wonder is it possible to use shuffle to order a list of unique pointers randomly and if so how?
Aucun commentaire:
Enregistrer un commentaire