title: boost::bind with templated functors
body: <p>Just trying to get this simple test working for accessing the function operator. I have dug around the boost::bind (esp for the <a href="http://www.boost.org/doc/libs/1_56_0/libs/bind/bind.html#err_overloaded" rel="nofollow">overloaded section </a> ) but have not found a way to get this to work.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #include &lt;boost/bind.hpp&gt;
  
  template &lt;typename FooType&gt;
  struct Foo {
      const FooType tmp_value;
  
      Foo(const FooType&amp; tmp_) :
      tmp_value(tmp_)
    {
    }
  
      template&lt;typename Object&gt;
    void operator()(Object&amp; operand)
    {
      std::cout &lt;&lt; operand &lt;&lt; std::endl;
      operand += tmp_value;
    }
  };
  
  int main() {
  
  
      double t = 4.0;
      Foo&lt;double&gt; e(1.0);
      std::cout &lt;&lt; t &lt;&lt; std::endl;
      e(t);   // Works
      std::cout &lt;&lt; t &lt;&lt; std::endl; 
  
      double d = 5.0;
      Foo&lt;double&gt; p(1.0);
      auto f1 = boost::bind(&amp;Foo::operator(), p, _1); // Blows up at compile
  
      std::cout &lt;&lt; d &lt;&lt; std::endl;
      f1(d); 
      std::cout &lt;&lt; d &lt;&lt; std::endl;
  
  }
  </code></pre>
  
  <p>Compiler output:</p>
  
  <pre><code>g++ -Wall --std=c++0x -I.  bind.cc -o binder
  bind.cc:33:25: error: expected a class or namespace
      auto f1 = boost::bind(&amp;Foo::operator(), p, _1); // Blows up at compile
                             ^
  </code></pre>
  
  <p>I know I am just missing something simple, any help would be awesome.</p>