On Wednesday, 21 October 2015 at 20:19:27 UTC, Timon Gehr wrote:
On 10/21/2015 01:05 PM, Andrei Alexandrescu wrote:
I'll attempt to implement a few versions of each and see what
they look
like. The question here is what containers are of interest for
D's
standard library.
There should probably also be wrappers that implement
optimizations for small containers.
I think the allocators can probably deal with that detail. If I
remember correctly there is an in-place allocator.
I've been using Boost.Container's small_vector lately (basically
a generalization of the now ubiquitous short string
optimization...though I'm not sure if it repurposes the pointer
when the item count is sufficiently small). It's a nice option to
have. The Container library now also has static_vector (fixed
capacity, changeable size) that fills a use gap between
std::array and std::vector;