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?
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_unpropagabledoes is take a pointer to allocated memory and returntrueif 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 insmall_vector.https://www.boost.org/doc/libs/1_65_0/boost/container/small_vector.hpp