#include "card.h"
#include "cardDeck.h"
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
CardDeck::CardDeck(bool newCardDeck)
{
if(!newCardDeck)
return;
for(int i = DIAMONDS; i <= SPADES; i++) {
for(int j = SIX; j <= ACE; j++) {
Card * temp = new Card(i, j);
deck.push_back(temp);
}
}
// shuffle the cards using built in function (in algorithm)
random_shuffle(deck.begin(), deck.end());
}
At first, compiler showing warning about depreciated with random shuffle then I change the format to std::shuffle and it shown up as "no matching function to "shuffle" in XCODE