title: Boost asio error when building class
body: <p>I'm trying to feel my way through doing some network programming using the Boost:asio libraries.  I've been using an asynchronous handler to transfer data from a given address and it works fine when I leverage asio as functions:</p>
  
  <pre><code>boost::asio::io_service io_service;
  boost::asio::ip::tcp::resolver resolver( io_service);
  boost::asio::ip::tcp::socket sock( io_service);
  boost::array &lt; char, 4096 &gt; buffer;
  
  void read_handler( const boost:: system:: error_code &amp;ec,
          std:: size_t bytes_transferred)
  {
      if (! ec)
          {
              if (std::string(buffer.data(), bytes_transferred) == "$")
              {
                      myss.str(std::string());
              }
              myss &lt;&lt; std::string(buffer.data(), bytes_transferred);
              if (int(buffer.data()[0]) == 10)
                  {
                      ....
  
                  }
              std::cout &lt;&lt; std::string(buffer.data(), bytes_transferred) ;//&lt;&lt; std::endl;
              sock.async_read_some( boost::asio::buffer( buffer), read_handler);
          }
  }
  
  void connect_handler( const boost::system::error_code &amp;ec)
  {
      if (! ec)
          {
              boost::asio::write( sock, boost::asio::buffer(
                      "GET / HTTP 1.1\r\nHost: www.google.com\r\n\r\n"));
              sock.async_read_some( boost::asio::buffer( buffer), read_handler);
          }
  }
  
  void resolve_handler( const boost::system::error_code &amp;ec,
          boost:: asio::ip::tcp::resolver::iterator it)
  {
      if (! ec)
          {
              sock.async_connect(* it, connect_handler);
          }
  }
  </code></pre>
  
  <p>Now, I'm trying to integrate these functions into a class but Visual Studio keeps complaining about the way I'm implementing the functions in the class.</p>
  
  <pre><code>void
  MyClass::connect_handler( const boost::system::error_code &amp;ec)
  {
      if (! ec)
          {
              //boost::asio::write( sock, boost::asio::buffer(
              //        "GET / HTTP 1.1\r\nHost: www.highscore.de\r\n\r\n"));
              m_sock.async_read_some( boost::asio::buffer( m_buffer), read_handler);
          }
  }
  
      : error C3867: 'MyClass::read_handler': function call missing argument list; use '&amp;MyClass::read_handler' to create a pointer to member: 
      error C3867: 'MyClass::read_handler': function call missing argument list; use '&amp;MyClass::read_handler' to create a pointer to member
      2&gt;'MyClass::connect_handler': function call missing argument list; use 
  
  '&amp;MyClass::connect_handler' to create a pointer to member
  2&gt;
  2&gt;Build FAILED.
  </code></pre>
  
  <p>Anyone got any pointers on what I'm doing wrong moving these into a class?</p>
  
  <p>I've tried implementing the recommend change in the error message, but it causes errors in the boost libraries themselves.</p>
  
  <pre><code>2&gt;C:\installs\Boost\include\boost-1_49\boost/asio/basic_stream_socket.hpp(785): error C2338: ReadHandler type requirements not met
  2&gt;          : see reference to function template instantiation 'void boost::asio::basic_stream_socket&lt;Protocol&gt;::async_read_some&lt;boost::asio::mutable_buffers_1,void(__thiscall MyClass::Sensor::* )(const boost::system::error_code &amp;,size_t)&gt;(const MutableBufferSequence &amp;,const ReadHandler &amp;)' being compiled
  2&gt;          with
  2&gt;          [
  2&gt;              Protocol=boost::asio::ip::tcp,
  2&gt;              MutableBufferSequence=boost::asio::mutable_buffers_1,
  2&gt;              ReadHandler=void (__thiscall MyClass::Sensor::* )(const boost::system::error_code &amp;,size_t)
  2&gt;          ]
  2&gt;C:\installs\Boost\include\boost-1_49\boost/asio/basic_stream_socket.hpp(785): error C2064: term does not evaluate to a function taking 2 arguments
  2&gt;C:\installs\Boost\include\boost-1_49\boost/asio/basic_socket.hpp(706): error C2338: ConnectHandler type requirements not met
  2&gt;           : see reference to function template instantiation 'void boost::asio::basic_socket&lt;Protocol,SocketService&gt;::async_connect&lt;void(__thiscall MyClass::Sensor::* )(const boost::system::error_code &amp;)&gt;(const boost::asio::ip::basic_endpoint&lt;InternetProtocol&gt; &amp;,const ConnectHandler &amp;)' being compiled
  2&gt;          with
  2&gt;          [
  2&gt;              Protocol=boost::asio::ip::tcp,
  2&gt;              SocketService=boost::asio::stream_socket_service&lt;boost::asio::ip::tcp&gt;,
  2&gt;              InternetProtocol=boost::asio::ip::tcp,
  2&gt;              ConnectHandler=void (__thiscall MyClass::Sensor::* )(const boost::system::error_code &amp;)
  2&gt;          ]
  2&gt;C:\installs\Boost\include\boost-1_49\boost/asio/basic_socket.hpp(706): error C2064: term does not evaluate to a function taking 1 arguments
  2&gt;
  </code></pre>