title: Boost variant and visitor
body: <p>I have 2 structures Base and Derived and boost:variant with 2 types. <br></p>
  
  <pre><code>struct Base : public boost::static_visitor&lt;&gt;
  {
      virtual void operator(Type1&amp; t) {}
      virtual void operator(Type2&amp; t) {}
  };
  </code></pre>
  
  <p>What I want to do is do define Derived as:</p>
  
  <pre><code>struct Derived : public Base
  {
      void operator(Type1&amp; t) { /*some impl*/ }
  };
  </code></pre>
  
  <p>I do not override operator for the Type2 assuming it is defined in Base and empty.</p>
  
  <p>For some reason if I write</p>
  
  <pre><code>Derived visitor;
  boost::apply_visitor(visitor, variant);
  </code></pre>
  
  <p>I get
  error: no match for call to '(Derived) (Type2&amp;)'</p>
  
  <p>Of course, if I add operator for Type2 into derived it works ok.<br>
  Could anyone please help to understand why it is not working without adding operator for Type2?</p>