shared_vector implementation

Shared ownership of a single C array.

Tracks offset and length for each instance
allowing each owner to "view" a different
piece of the array.

Parts of shared_vector<T> which can work
for T=void are in shared_vector_base<T>.
Specializations shared_vector<void>
and shared_vector<const void> handle
un-typed arrays.

Allow casting to/from typed vector

Offsets and sizes of untyped vectors are tracked in
bytes.  Therefore casting to types where sizeof(T)>1
is undefined if the offset is not a multiple of
sizeof(T).
This commit is contained in:
Michael Davidsaver
2013-05-08 18:21:34 -04:00
parent 461dbdf0f8
commit 3cd2bfdef0
3 changed files with 736 additions and 1 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ namespace detail {
*
* Takes advantage of the requirement that all exception classes
* must be copy constructable. Of course this also requires
* the and extra copy be constructed...
* that an extra copy be constructed...
*/
template<typename E>
class ExceptionMixed : public E, public ExceptionMixin {