title: Error: Member is inaccessible
body: <p>I have these two classes:</p>
  
  <pre><code>class Hand
  {
  public:
      int getTotal();
      std::vector&lt;Card&gt;&amp; getCards();
      void add(Card&amp; card);
      void clear();
  private:
      std::vector&lt;Card&gt; cards;
  };
  
  class Deck : public Hand
  {
  public:
      void rePopulate();
      void shuffle();
      void deal(Hand&amp; hand);
  };
  </code></pre>
  
  <p>Where the <code>shuffle()</code> function is declared as follows:</p>
  
  <pre><code>void Deck::shuffle()
  {
      std::random_shuffle(cards.begin(), cards.end());
  }
  </code></pre>
  
  <p>However, this returns the following error:</p>
  
  <pre><code>'Hand::cards' : cannot access private member declared in class 'Hand'
  </code></pre>
  
  <p>Should I just include a function such as<code>std::vector&lt;Card&gt;&amp; getCards()</code> or is there another way to avoid the error.</p>