• 欢迎浏览“String me = Creater\忠实的资深Linux玩家;”,请文明浏览,理性发言,有侵犯你的权益请邮件我(creater@vip.qq.com).
  • 把任何的失败都当作一次尝试,不要自卑;把所有的成功都想成是一种幸运,不要自傲。
  •    4年前 (2014-03-18)  boost.buffer 评论关闭  30 
    文章评分 0 次,平均分 0.0

    MutableBufferSequence中需要定义哪些类型或者函数:

    /// Adapts a single modifiable buffer so that it meets the requirements of the
    /// MutableBufferSequence concept.
    class mutable_buffers_1
      : public mutable_buffer
    {
    public:
      /// The type for each element in the list of buffers.
      typedef mutable_buffer value_type;
    
      /// A random-access iterator type that may be used to read elements.
      typedef const mutable_buffer* const_iterator;
    
      /// Construct to represent a given memory range.
      mutable_buffers_1(void* data, std::size_t size)
        : mutable_buffer(data, size)
      {
      }
    
      /// Construct to represent a single modifiable buffer.
      explicit mutable_buffers_1(const mutable_buffer& b)
        : mutable_buffer(b)
      {
      }
    
      /// Get a random-access iterator to the first element.
      const_iterator begin() const
      {
        return this;
      }
    
      /// Get a random-access iterator for one past the last element.
      const_iterator end() const
      {
        return begin() + 1;
      }
    };

    MutableBufferSequence中需要定义哪些类型或者函数:

    /// Adapts a single non-modifiable buffer so that it meets the requirements of
    /// the ConstBufferSequence concept.
    class const_buffers_1
      : public const_buffer
    {
    public:
      /// The type for each element in the list of buffers.
      typedef const_buffer value_type;
    
      /// A random-access iterator type that may be used to read elements.
      typedef const const_buffer* const_iterator;
    
      /// Construct to represent a given memory range.
      const_buffers_1(const void* data, std::size_t size)
        : const_buffer(data, size)
      {
      }
    
      /// Construct to represent a single non-modifiable buffer.
      explicit const_buffers_1(const const_buffer& b)
        : const_buffer(b)
      {
      }
    
      /// Get a random-access iterator to the first element.
      const_iterator begin() const
      {
        return this;
      }
    
      /// Get a random-access iterator for one past the last element.
      const_iterator end() const
      {
        return begin() + 1;
      }
    };

     

     

    除特别注明外,本站所有文章均为String me = "Creater\忠实的资深Linux玩家";原创,转载请注明出处来自http://unix8.net/home.php/3333.html

    关于
    切换注册

    登录

    忘记密码 ?

    切换登录

    注册

    扫一扫二维码分享