title: How to write to a boost::asio::mutable_buffer?
body: <p>I have some code that provides me with a pointer to a buffer, and the buffer's size that I need to fill with data.  I represent this buffer with a <code>boost::asio::mutable_buffer</code> instance, but how do I properly use this buffer (e.g. write a string to it, ...) and have boost enforce the buffer boundaries?</p>
  
  <p>Here's some pseudo code:</p>
  
  <pre><code>size_t some_callback(void *ptr, size_t) {
      // this function is called by 3rd party
      return our_handler(boost::asio::mutable_buffer(ptr, size));
  }
  
  size_t our_handler(const boost::asio::mutable_buffer &amp;buffer)
  {
      const std::string test("test");
      // How do I write this string into my buffer?
      return test.size();
  }
  </code></pre>