
Hi Robert, "Stewart, Robert" <Robert.Stewart@sig.com> 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 -- Boris Kolpackov, Code Synthesis http://codesynthesis.com/~boris/blog Compiler-based ORM system for C++ http://codesynthesis.com/products/odb Open-source XML data binding for C++ http://codesynthesis.com/products/xsd XML data binding for embedded systems http://codesynthesis.com/products/xsde