
2013/1/22 Olaf van der Spek <ml@vdspek.org>:
On Tue, Jan 22, 2013 at 2:33 PM, Adam Wulkiewicz <adam.wulkiewicz@gmail.com> wrote:
That's just a single bit.
No, because static part will be created on stack and if external storage was created by non-std allocator then hybrid_vector would have a full set of additional members.
You need either those members or the static storage, not both at the same time, so they could share the same space.
Yes, then additional creation and move of those members would be needed while moving to the new memory but this is probably not significant. On the other hand we could store the whole static_vector or vector in the storage inside the hybrid_vector. We couldn't use size/capacity to store this flag bit but I'm not so sure if I'd do it anyway because it would decrease the max size of the container. And again creation and move of a vector would be required like in the previous case, this time with allocator which is stored inside. Regards, Adam