title: boost::asio buffer impossible to convert parameter from char to const mutable_buffer&
body: <p>visual studio tells me "error C2664: 'boost::asio::mutable_buffer::mutable_buffer(const boost::asio::mutable_buffer&amp;)': impossible to convert parameter 1 from 'char' to 'const boost::asio::mutable_buffer&amp;' at line 163 of consuming_buffers.hpp"</p>
  
  <p>I am unsure of why this happen nor how to solve it(otherwise I wouldn't ask this ^^') but I think it could be related to those functions.. even tough I tried them in another project and everything worked fine... but I can hardly find what's different</p>
  
  <p>so... here comes code that could be relevant, if anything useful seems to be missing I'll be glad to send it.</p>
  
  <p>packets are all instances of this class.</p>
  
  <pre><code>class CPacketBase
  {
  protected:
   const unsigned short _packet_type;
   const size_t _size;
   char* _data;
  
  public:
   CPacketBase(unsigned short packet_type, size_t size);
   ~CPacketBase();
  
   size_t get_size();
   const unsigned short&amp; get_type();
   virtual char* get();
   virtual void set(char*);
  };
  </code></pre>
  
  <p>this sends a given packet</p>
  
  <pre><code>    template &lt;typename Handler&gt; 
   void async_write(CPacketBase* packet, Handler handler)
   {
    std::string outbuf;
    outbuf.resize(packet-&gt;get_size());
    outbuf = packet-&gt;get();
    boost::asio::async_write( _socket
     , boost::asio::buffer(outbuf, packet-&gt;get_size())
     , handler);
   }
  </code></pre>
  
  <p>this enable reading packets and calls a function that decodes the packet's header(unsigned short) and resize the buffer to send it to another function that reads the real data from the packet</p>
  
  <pre><code>template &lt;typename Handler&gt; 
   void async_read(CPacketBase* packet, Handler handler)
   {
    void (CTCPConnection::*f)( const boost::system::error_code&amp;
        , CPacketBase*, boost::tuple&lt;Handler&gt;)
         = &amp;CTCPConnection::handle_read_header&lt;Handler&gt;;
    boost::asio::async_read(_socket, _buffer_data
     , boost::bind( f
      , this
      , boost::asio::placeholders::error
      , packet
      , boost::make_tuple(handler)));
   }
  </code></pre>
  
  <p>and this is called by async_read once a packet is received</p>
  
  <pre><code>template &lt;typename Handler&gt; 
   void handle_read_header(const boost::system::error_code&amp; error, CPacketBase* packet, boost::tuple&lt;Handler&gt; handler)
   {
    if (error)
    {
     boost::get&lt;0&gt;(handler)(error);
    }
    else
    {
     // Figures packet type
     unsigned short packet_type = *((unsigned short*) _buffer_data.c_str());
  
     // create new packet according to type
     delete packet;
     ...
  
     // read packet's data
     _buffer_data.resize(packet-&gt;get_size()-2); // minus header size
  
     void (CTCPConnection::*f)( const boost::system::error_code&amp;
       , CPacketBase*, boost::tuple&lt;Handler&gt;)
         = &amp;CTCPConnection::handle_read_data&lt;Handler&gt;;
     boost::asio::async_read(_socket, _buffer_data
      , boost::bind( f
       , this
       , boost::asio::placeholders::error
       , packet
       , handler));
    }
   }
  </code></pre>