title: Why can I not pass my class pointer to my visitor class? It says there are no matching functions
body: <p>Essentially this visitor class was working until I tried to add another class to it.</p>
  
  <p>The is the visitor class I am going to refer to:</p>
  
  <h2>Visitor.h</h2>
  
  <pre><code>#ifndef Visitor_h__
  #define Visitor_h__
  
  #include &lt;stdint.h&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  
  namespace Ph2_System
  {
      class SystemController;
  }
  
  namespace GUI
  {
      class SystemControllerWorker;
  }
  
  class HwDescriptionVisitor
  {
    public:
       //SystemController
      virtual void visit( Ph2_System::SystemController&amp; pSystemController ) {} //This one works
  
      //SystemControllerWorker
      virtual void visit( GUI::SystemControllerWorker&amp; pSystemControllerWorker ) {}
  }
  </code></pre>
  
  <p>This is the class which tries to call a visit on it:</p>
  
  <h2>SystemControllerWorker.h</h2>
  
  <pre><code>#include "../HWInterface/Visitor.h"
  #include "Model/settings.h"
  
  namespace GUI
  {
  
      class SystemControllerWorker
      {
        public:
  
          SystemControllerWorker(Settings &amp;config);
          ~SystemControllerWorker();
  
           void accept( HwDescriptionVisitor&amp; pVisitor ) const {
            pVisitor.visit( *this ); // this is where I get my error message
            for ( auto&amp; cShelve : fShelveVector )
                cShelve-&gt;accept( pVisitor );
           }
        private:
          Settings&amp; m_Settings; //takes in the above &amp;config in the contructor
  </code></pre>
  
  <p>The only difference between the <code>SystemController</code> and <code>SystemControllerWorker</code> is the first one doesn't take in any arguments, and this one does. Any idea why I get this error message:</p>
  
  <pre><code>error: no matching function for call to "HwDescriptionVisitor::visit(const GUI::SystemControllerWorker&amp;)"
             pVisitor.visit( *this );
  </code></pre>
  
  <p>Or what this might mean?</p>