title: C2676 error with reference_wrapper and custom class
body: <p>I am working on my C++ home-project and got into trouble with the following <code>C2676</code> error:</p>
  <p><code>binary '==': 'std::reference_wrapper&lt;Interactable&gt;' does not define this operator or a conversion to a type acceptable to the predefined operator</code></p>
  <p>I have this in my World class and I am pretty sure the find is what invokes the above error:</p>
  <pre><code>void RemoveObject(Interactable* object)
  {
      if (!object) return;
      auto itr = std::find(dynamicWorldObjects.begin(), dynamicWorldObjects.end(), *object);
      if (itr == dynamicWorldObjects.end()) return;
      dynamicWorldObjects.erase(itr);
  }
  </code></pre>
  <p>And my Interactable looks like this:</p>
  <pre><code>class Interactable
  {
  public:
      Vector2 Position;
      Vector2 Velocity;
      Shape Shape;
  
      Interactable(const std::string&amp; path, SDL_Renderer* rend, int id)
      {
          _id = id;
          SDL_Surface* surface = IMG_Load(path.c_str());
          _texture = SDL_CreateTextureFromSurface(rend, surface);
          _destination.w = surface-&gt;w;
          _destination.h = surface-&gt;h;
          SDL_FreeSurface(surface);
      }
  
      ~Interactable()
      {
          SDL_DestroyTexture(_texture);
      }
  
      void Render(SDL_Renderer* rend)
      {
          _destination.x = Position.X;
          _destination.y = Position.Y;
  
          SDL_RenderCopy(rend, _texture, NULL, &amp;_destination);
      }
  
      int GetID() const
      {
          return _id;
      }
  
      bool operator == (const Interactable&amp; A) const
      {
          return this-&gt;GetID() == A.GetID();
      }
  
  private:
      SDL_Rect _destination;
      SDL_Texture* _texture;
      int _id;
  };
  </code></pre>
  <p>My question is how am I able to resolve the comparison of these reference_wrappers? Am I missing something or my approach went wrong?</p>
  <p>Thank you for the input!</p>
  <p>Edit1:
  My World class starts with this:</p>
  <pre><code>class World
  {
  private:
      std::vector&lt;std::reference_wrapper&lt;Interactable&gt; &gt; staticWorldObjects;
      std::vector&lt;std::reference_wrapper&lt;Interactable&gt; &gt; dynamicWorldObjects;
      int _id;
  
  public:
      World()
      {
          staticWorldObjects = std::vector&lt;std::reference_wrapper&lt;Interactable&gt; &gt;();
          dynamicWorldObjects = std::vector&lt;std::reference_wrapper&lt;Interactable&gt; &gt;();
          _id = 0;
      }
  ...
  }```
  </code></pre>