
I wrote:
Yes quite. i.e. What you believe is not true about boost::allocate_unique.
i.e. For auto p = boost::allocate_unique<T[]>(a, n); assert(p.get().size() == n);
This is because the unique_ptr stores a pointer adaptor around the Allocator::pointer which also stores the size.
So the pointer and size are stored together in the unique_ptr result.
Note, that the size is only stored for allocate_unique<T[]>(a,n) but not for allocate_unique<T[N]>(a) since there the N is known at compile time. For auto p = allocate_unique<T[N]>(a); your p.get().size() will return N, but there's no need to store a size_t for N, so we don't.
To get the plain Allocator::pointer out of it you can use p.get().ptr()
Or, for example, p.release().ptr() for someone who wants to manage it themselves.
Glen