title: Invoking a function from another class with Boost in c++
body: <p>I am fairly new to both c++ and the boost library.</p>
  
  <p>What I want to do is invoke a method <code>foo</code> from a class <code>Bar</code> inside a class <code>Baz</code>. Here is basically what I want to achieve:</p>
  
  <pre><code>Baz::doSomething() {
      Bar bar;
  
      boost::thread qux(bar.foo);
  }
  </code></pre>
  
  <p>And the <code>foo</code> function could be something like:</p>
  
  <pre><code>// bar.cpp
  
  void foo() {
      const int leet = 1337; // Very useful
  }
  </code></pre>
  
  <p>However, when I try to compile it tells me that:</p>
  
  <pre><code>error: no matching function for call to ‘boost::thread::thread(&lt;unresolved overloaded function type&gt;)’
  /usr/local/include/boost/thread/detail/thread.hpp:215:9: note: candidates are: boost::thread::thread(boost::detail::thread_move_t&lt;boost::thread&gt;)
  /usr/local/include/boost/thread/detail/thread.hpp:201:18: note:                 boost::thread::thread(F, typename boost::disable_if&lt;boost::is_convertible&lt;T&amp;, boost::detail::thread_move_t&lt;T&gt; &gt;, boost::thread::dummy*&gt;::type) [with F = void (Snake::*)(), typename boost::disable_if&lt;boost::is_convertible&lt;T&amp;, boost::detail::thread_move_t&lt;T&gt; &gt;, boost::thread::dummy*&gt;::type = boost::thread::dummy*]
  /usr/local/include/boost/thread/detail/thread.hpp:154:9: note:                 boost::thread::thread()
  /usr/local/include/boost/thread/detail/thread.hpp:122:18: note:                 boost::thread::thread(boost::detail::thread_data_ptr)
  /usr/local/include/boost/thread/detail/thread.hpp:113:9: note:                 boost::thread::thread(boost::thread&amp;)
  </code></pre>
  
  <p>What am I missing here?</p>