title: Why am I getting this 'enum' is not a class or a namespace error?
body: <p>I need call a method with this signature in my Manager class:</p>
  
  <pre><code>void createPlayer(Player&amp; player, PlayerType&amp; playerType);
  </code></pre>
  
  <p>I have a Player defined like so:</p>
  
  <pre><code>using namespace std;
  
  enum PlayerType { FORWARD, DEFENSEMAN, GOALIE };
  
  class Player {
    public:
      Player();
      void setType(PlayerType);
    private:
      PlayerType type;
  };
  </code></pre>
  
  <p>This is how I try to call the method in main ...</p>
  
  <pre><code>#include "Player.h"
  #include "Manager.h"
  
  int main() {
  
    Manager manager;
    Player player;
    PlayerType t = PlayerType::FORWARD;
    manager.createPlayer(player, t);
  
    return 0;
  }
  </code></pre>
  
  <p>... but it fails to compile with this error:</p>
  
  <pre><code>Main.cc: In function ‘int main()’:
  Main.cc:12:18: error: ‘PlayerType’ is not a class or namespace
  </code></pre>
  
  <p>Any ideas?  Note: I cannot change the signature of the createPlayer method.</p>