Chapter 44. A reference-counted vector class

#include <x/vector.H>

x::vector<char> vecref(x::vector<char>::create());

The x::vector template class defines a reference-counted std::vector. In this example, *vecref is type convertible to a std::vector<char>, and may be used in any context that requires it.

This template class provides a convenient way to define reference-counted std::vector buffers. Additionally, the class provides methods for reading or writing the contents of a vector to a file (usable, of course, only with vectors of Plain Old Data).