title: boost bind callback function pointer as a parameter
body: <p>I am trying to pass a function pointer using boost::bind. </p>
  
  <pre><code>void
  Class::ThreadFunction(Type(*callbackFunc)(message_type::ptr&amp;))
  {
  }
  
  boost::shared_ptr&lt;boost::thread&gt;
  Class::Init(Type(*callbackFunc)(message_type::ptr&amp;))
  {
      return boost::shared_ptr&lt;boost::thread&gt; (
          new boost::thread(boost::bind(&amp;Class::ThreadFunction, callbackFunc))
          );
  }
  </code></pre>
  
  <p>I get the following errors:</p>
  
  <pre><code>1&gt;C:\dev\sapphire\boost_1_46_1\boost/bind/mem_fn.hpp(362) : warning C4180: qualifier applied to function type has no meaning; ignored
  1&gt;C:\dev\sapphire\boost_1_46_1\boost/bind/mem_fn.hpp(333) : error C2296: '-&gt;*' : illegal, left operand has type 'Type (__cdecl **)(message_type::ptr &amp;)'
  </code></pre>
  
  <p>However, I was able to change to the following, it works fine:</p>
  
  <pre><code>void
  ThreadFunction(Type(*callbackFunc)(message_type::ptr&amp;))
  {
  }
  
  boost::shared_ptr&lt;boost::thread&gt;
  Class::Init(Type(*callbackFunc)(message_type::ptr&amp;))
  {
      return boost::shared_ptr&lt;boost::thread&gt; (
          new boost::thread(boost::bind(&amp;ThreadFunction, callbackFunc))
          );
  }
  </code></pre>
  
  <p>Why do I get those errors if I declare the method in the Class class?</p>