title: Boost: Comparing variants with apply_visitor
body: <p>Could somebody please tell me why I am getting compiler error for the last line of the following code?</p>
  
  <p><em>note</em>: If I remove the following line, my code gets compiled with no error:</p>
  
  <pre><code>appliedEqualityVisitor(compareValue);
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>#include "boost/variant/variant.hpp"
  #include "boost/variant/apply_visitor.hpp"
  
  using namespace std;
  using namespace boost;
  
  
  template&lt;typename T&gt;
  struct CheckOneTypeEquality : public boost::static_visitor&lt;&gt;
  {
      T const* value;
      bool operator()( T const&amp; other ) const
      {
          return other == *value;
      }
      template&lt;typename U&gt;
      bool operator()( U const&amp; other ) const
      {
          return false;
      }
      CheckOneTypeEquality( T const&amp; value_ ):value(&amp;value_) {}
  };
  
  typedef variant&lt;int, string&gt; MyVariant;
  typedef apply_visitor_delayed_t&lt;CheckOneTypeEquality&lt;MyVariant&gt;&gt; AppliedEqualityVisitorType;
  
  int main(int argc, char **argv) 
  {
      int testValue = 12;
      CheckOneTypeEquality&lt;MyVariant&gt; equalityVisitor(testValue);
  
      AppliedEqualityVisitorType appliedEqualityVisitor = apply_visitor(equalityVisitor);
  
      MyVariant compareValue = 13;
      appliedEqualityVisitor(compareValue); // &lt;&lt;&lt;&lt;&lt; compile error here
  
      return 0;
  }
  </code></pre>