title: Why my deque won't pop_front when I call the method that tells it to?
body: <p>So, I have a project and one of my class methods is supposed to pop_front the deque, mydeque. When I call one.play() in my main, and run the program, it does not pop the deque. The program is supposed to let the user enter how many cards they want, and then generate a random number each time a card is pulled and to compare the values on the cards. If the random number is less than the card number, then the score is incremented by one. But in order for that to work, I need to pop the front of the deque and compare new numbers to the new front of the deque each time. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;deque&gt;
  using namespace std;
  
  class Player {
  
      private:
  
  
              size_t cards;
              deque&lt;int&gt; mydeque;
      public:
              string name;
              int score;
  
              Player(string player) {
                      name = player;
                      score = 0;
  
              }
  
              void recieve(size_t card){
  
                 mydeque.push_front (card);
              }
              int play() {
                      return mydeque.front();
                      mydeque.pop_front();
              }
  
              ~Player() {
                      name = " ";
                      score = 0;
              }
              void tostring(ostream &amp; out) const{
  
                      out &lt;&lt; "player name : "&lt;&lt; name &lt;&lt; endl;
                      out &lt;&lt; "score : " &lt;&lt; score &lt;&lt; endl;
                      out &lt;&lt; "cards : " &lt;&lt; mydeque.size() &lt;&lt; endl;
                      for(int i =0; i &lt;mydeque.size();i++)
                              out &lt;&lt; mydeque[i] &lt;&lt; " " ;                       
              }
  
  };
  
              ostream &amp; operator &lt;&lt;(ostream &amp; out, const Player &amp; p){
                      p.tostring(out);
                      return out;}
  
  int main () {
      int rounds;
      cout &lt;&lt; "Give the number of rounds: "&lt;&lt;endl;
      cin &gt;&gt; rounds;
      Player one("some player");
      for (int i = 1; i &lt; rounds+1; i++){
              one.recieve(i);
  
      }
  
  
      for( int i = 0; i &lt; rounds; i++) {
              one.play();
              int randnum = rand()%(rounds-1 + 1) + 1;
  
              cout &lt;&lt; one &lt;&lt; endl;
              cout &lt;&lt; " The dealer draws : " &lt;&lt; randnum &lt;&lt; endl;
  
   if (randnum &lt; one.play()){
                      one.score = one.score + 1;}}
  
  
  
      return 0;
  
  }
  </code></pre>