title: functional, bind1st and mem_fun
body: <p>Why won't this compile?</p>
  
  <pre><code>#include &lt;functional&gt; 
  #include &lt;boost/function.hpp&gt; 
  
  class A { 
      A() { 
          typedef boost::function&lt;void ()&gt; FunctionCall; 
          FunctionCall f = std::bind1st(std::mem_fun(&amp;A::process), this); 
      } 
      void process() {} 
  };
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code>In file included from /opt/local/include/gcc44/c++/bits/stl_function.h:712,
                   from /opt/local/include/gcc44/c++/functional:50,
                   from a.cc:1:
  /opt/local/include/gcc44/c++/backward/binders.h: In instantiation of 'std::binder1st&lt;std::mem_fun_t&lt;void, A&gt; &gt;':
  a.cc:7:   instantiated from here
  /opt/local/include/gcc44/c++/backward/binders.h:100: error: no type named 'second_argument_type' in 'class std::mem_fun_t&lt;void, A&gt;'
  /opt/local/include/gcc44/c++/backward/binders.h:103: error: no type named 'first_argument_type' in 'class std::mem_fun_t&lt;void, A&gt;'
  /opt/local/include/gcc44/c++/backward/binders.h:106: error: no type named 'first_argument_type' in 'class std::mem_fun_t&lt;void, A&gt;'
  /opt/local/include/gcc44/c++/backward/binders.h:111: error: no type named 'second_argument_type' in 'class std::mem_fun_t&lt;void, A&gt;'
  /opt/local/include/gcc44/c++/backward/binders.h:117: error: no type named 'second_argument_type' in 'class std::mem_fun_t&lt;void, A&gt;'
  /opt/local/include/gcc44/c++/backward/binders.h: In function 'std::binder1st&lt;_Operation&gt; std::bind1st(const _Operation&amp;, const _Tp&amp;) [with _Operation = std::mem_fun_t&lt;void, A&gt;, _Tp = A*]':
  a.cc:7:   instantiated from here
  /opt/local/include/gcc44/c++/backward/binders.h:126: error: no type named 'first_argument_type' in 'class std::mem_fun_t&lt;void, A&gt;'
  In file included from /opt/local/include/boost/function/detail/maybe_include.hpp:13,
                   from /opt/local/include/boost/function/detail/function_iterate.hpp:14,
                   from /opt/local/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:47,
                   from /opt/local/include/boost/function.hpp:64,
                   from a.cc:2:
  /opt/local/include/boost/function/function_template.hpp: In static member function 'static void boost::detail::function::void_function_obj_invoker0&lt;FunctionObj, R&gt;::invoke(boost::detail::function::function_buffer&amp;) [with FunctionObj = std::binder1st&lt;std::mem_fun_t&lt;void, A&gt; &gt;, R = void]':
  /opt/local/include/boost/function/function_template.hpp:913:   instantiated from 'void boost::function0&lt;R&gt;::assign_to(Functor) [with Functor = std::binder1st&lt;std::mem_fun_t&lt;void, A&gt; &gt;, R = void]'
  /opt/local/include/boost/function/function_template.hpp:722:   instantiated from 'boost::function0&lt;R&gt;::function0(Functor, typename boost::enable_if_c&lt;boost::type_traits::ice_not::value, int&gt;::type) [with Functor = std::binder1st&lt;std::mem_fun_t&lt;void, A&gt; &gt;, R = void]'
  /opt/local/include/boost/function/function_template.hpp:1064:   instantiated from 'boost::function&lt;R()&gt;::function(Functor, typename boost::enable_if_c&lt;boost::type_traits::ice_not::value, int&gt;::type) [with Functor = std::binder1st&lt;std::mem_fun_t&lt;void, A&gt; &gt;, R = void]'
  a.cc:7:   instantiated from here
  /opt/local/include/boost/function/function_template.hpp:153: error: no match for call to '(std::binder1st&lt;std::mem_fun_t&lt;void, A&gt; &gt;) ()'
  </code></pre>