What does boost::container::allocator_traits::is_partially_propagable mean?

80 Views Asked by At

I was tring to understand boost::container::allocator_traits when I encountered boost::container::allocator_traits::is_partially_propagable.

I can't find any other document about it online, and I can understand all the other members of boost::container::allocator_traits except is_partially_propagable and storage_is_unpropagable.

Edit:

And, how they're implemented and how to use them when writing a container?

1

There are 1 best solutions below

6
imreal On BEST ANSWER

It (is_partially_propagable) means that the allocator uses internal storage (it has state), and not all memory allocated by it can be deallocated by another allocator, even if both compare equal. (Allocators of the same type are supposed to always compare equal and be interchangeable)

What storage_is_unpropagable does is take a pointer to allocated memory and return true if this is memory that is not propagable. (Since not all memory has to be unpropagable)

This allocator (small_vector_allocator) is used as a space optimization in small_vector.

https://www.boost.org/doc/libs/1_65_0/boost/container/small_vector.hpp