Boost logo

Boost :

Subject: Re: [boost] Interest in a simple buffer abstraction?
From: Boris Kolpackov (boris_at_[hidden])
Date: 2011-01-27 14:33:45

Hi Robert,

"Stewart, Robert" <Robert.Stewart_at_[hidden]> writes:

> The idea has merit, but I wonder if an adaptor approach would be better.
> That is, permit construction of your buffer type from various other
> storage types, like std::vector, boost::array, char [], etc., and
> simply adapt them to a common interface for use by other code.

This way I would have to write:

class packet
  packet (void* data, size_t size)
    : data_ (data_storage_, data, size)

  std::vector data_storage_;
  boost::buffer data_;

Which i find quite hairy.


Boris Kolpackov, Code Synthesis
Compiler-based ORM system for C++
Open-source XML data binding for C++
XML data binding for embedded systems

Boost list run by bdawes at, gregod at, cpdaniel at, john at