title: Const mismatches: 2 overloads have no legal conversion for 'this' pointer
body: <p>I'm getting this weird error: </p>
  
  <blockquote>
    <p>error C2663:
    'sf::Drawable::SetPosition' : 2
    overloads have no legal conversion for
    'this' pointer</p>
  </blockquote>
  
  <p>I think it has something to do with const mismatches but I don't know where, or why.
  In the following code I have a vector of shapes and sprites, and when trying to access one of the vectors shapes and calling one of its functions I'm getting the error.</p>
  
  <pre><code>std::vector&lt;sf::Shape&gt; Shapes;
  std::vector&lt;sf::Sprite&gt; Sprites;
  
  bool AddShape(sf::Shape&amp; S){
      Shapes.push_back(S); return true;
  };
  bool AddSprite(sf::Sprite&amp; S){
      Sprites.push_back(S); return true;
  };
  
  private:
  
  virtual void Render(sf::RenderTarget&amp; target) const {                
      for(unsigned short I; I&lt;Shapes.size(); I++){
          Shapes[I].SetPosition(
              Shapes[I].GetPosition().x + GetPosition().x,
              Shapes[I].GetPosition().y + GetPosition().y);
          target.Draw(Shapes[I]);
      }
      for(unsigned short I; I&lt;Sprites.size(); I++){
          target.Draw(Sprites[I]);
      }
  }
  </code></pre>
  
  <p><strong>How can I fix this?</strong></p>