title: Boost asio ConstBufferSequence - c++ Templates
body: <p>I am hoping for some guidance regarding C++ templates. I have been using the <code>boost::asio</code> library for communication over TCP. Thus far, I have been using storage containers built into the boost::asio library. For instance:</p>
  
  <pre><code>boost::array&lt;char, 128&gt; buf;
  boost::system::error_code error;
  size_t len = socket.read_some(boost::asio::buffer(buf), error);
  </code></pre>
  
  <p>To read from a socket, I simply wrap a buffer of type <code>boost::asio::buffer</code> around my <code>boost::array</code> object. This works fine, but now I'd like to work in the reverse direction. That is, I'd like to write back into the socket, pulling data from some custom storage classes I already have. <strong>My question is, how do I make sense of the template type requirements required to be wrappable by boost::asio::buffer, or more generally, the parameter type specified by:</strong></p>
  
  <pre><code>template&lt;typename ConstBufferSequence&gt;
  std::size_t send(   
     const ConstBufferSequence &amp; buffers
  );
  </code></pre>
  
  <p>The <a href="http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference.html" rel="nofollow">API</a> lists the requirements of a <a href="http://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/ConstBufferSequence.html" rel="nofollow">ConstBufferSequence</a>, but I can't make heads or tails of this. Can somebody help me understand? What methods would the type I want to pass to the "send" function need to expose?</p>