Don't get me wrong, the functionality is really useful. But:
Now, most (all?) methods of vector need to be "duplicated" in inplace_vector.
None of the other collections benefit. Not even std::string.
A more general solution to the problem would have been an inplace_allocator -- which requires a different API than allocator -- which could be applied to every container (standard or not).
The concept is useful, especially in a gpu environment where you can’t allocate memory dynamically. Also, inplace_allocator just adds another layer of complexity when all I want is something like a static vector
6
u/matthieum 5d ago
Honestly, I'm a bit saddened by this addition.
Don't get me wrong, the functionality is really useful. But:
vectorneed to be "duplicated" ininplace_vector.std::string.A more general solution to the problem would have been an
inplace_allocator-- which requires a different API thanallocator-- which could be applied to every container (standard or not).