From 657118f037869ebb4e8da42edc0bd4e7e361ecbe Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 11 Jun 2015 00:14:19 +0100 Subject: [PATCH] simpler and more correct vector packed pair --- octa/vector.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/octa/vector.h b/octa/vector.h index d7bf4fa..e87d39b 100644 --- a/octa/vector.h +++ b/octa/vector.h @@ -19,16 +19,16 @@ namespace octa { namespace detail { - template::value> + template::value> struct VectorPair; - template - struct VectorPair { /* non-empty allocator */ - T *p_ptr; - A p_a; + template + struct VectorPair { /* non-empty allocator */ + octa::AllocatorPointer p_ptr; + A p_a; template - VectorPair(T *ptr, U &&a): p_ptr(ptr), + VectorPair(octa::AllocatorPointer ptr, U &&a): p_ptr(ptr), p_a(octa::forward(a)) {} A &get_alloc() { return p_a; } @@ -40,12 +40,12 @@ namespace detail { } }; - template - struct VectorPair: A { /* empty allocator */ - T *p_ptr; + template + struct VectorPair: A { /* empty allocator */ + octa::AllocatorPointer p_ptr; template - VectorPair(T *ptr, U &&a): + VectorPair(octa::AllocatorPointer ptr, U &&a): A(octa::forward(a)), p_ptr(ptr) {} A &get_alloc() { return *this; } @@ -59,7 +59,7 @@ namespace detail { template> class Vector { - using VecPair = octa::detail::VectorPair; + using VecPair = octa::detail::VectorPair; VecPair p_buf; octa::Size p_len, p_cap;