json icon indicating copy to clipboard operation
json copied to clipboard

No object::shrink_to_fit?

Open vinniefalco opened this issue 3 years ago • 3 comments

Why is there no object::shrink_to_fit ?

vinniefalco avatar Jul 25 '21 19:07 vinniefalco

Do any associative containers have that? I've checked Unordered, and it's do not.

grisumbras avatar Apr 08 '24 17:04 grisumbras

the question is not if associative containers have that, but rather whether vectors and vector-like containers have that. json::object is not node-based it is linear

vinniefalco avatar Apr 08 '24 19:04 vinniefalco

boost::unordered_flat_map has rehash which apprarently can do the equivalent of shrink_to_fit and more. Maybe we should explore this.

grisumbras avatar Apr 11 '24 17:04 grisumbras