title: Object has type qualifiers that are not compatible with the member function
body: <p>My class <code>Game</code> has a member <code>EntityManager entityManager_</code>.</p>
  
  <p>The class <code>EntityManager</code> has a private member <code>Player player_</code> and the public getter function <code>Player &amp;EntityManager::getPlayer()</code> which returns <code>player_</code>.</p>
  
  <p>The class <code>Player</code> has for example the functions <code>void startMoving()</code> and <code>sf::Vector2f getPosition() const</code>.</p>
  
  <p>Now, I can without problems call <code>entityManager_.getPlayer().startMoving();</code> from within my <code>Game</code> class, but when I try for example the following code to get the player's position:</p>
  
  <p><code>sf::Vector2f playerPosition = entityManager_.getPlayer().getPosition();</code> </p>
  
  <p>I get the following error:</p>
  
  <p>IntelliSense:</p>
  
  <pre><code>EntityManager Game::entityManager_
  
  Error: the object has type qualifiers that are not compatible with the member function
  
  object type is: const EntityManager
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>game.cpp(261): error C2662: 'EntityManager::getPlayer' : cannot convert 'this' pointer from 'const EntityManager' to 'EntityManager &amp;'
            Conversion loses qualifiers
  </code></pre>
  
  <p>I tried removing the <code>const</code> from the player's getPosition function but nothing changed.</p>
  
  <p>I know it probably has something to do with the <code>const</code> but I can't figure out what to change! Could someone please help me?</p>