boostorg / container

STL-like containers from Boost
http://www.boost.org/libs/container/
Boost Software License 1.0
101 stars 113 forks source link

added alignment specification for small_vector #47

Closed tobias-loew closed 5 years ago

tobias-loew commented 7 years ago

Hi, in order to be able to use small_vectors for SSE aligned doubles, I've added an alignment specification for small_vector which ensures alignment of the internal-storage. The default value of 0 for the new template parameter ensures the original alignment-calculation.

Tobias

igaztanaga commented 5 years ago

Thanks for the report. I've added options to small_vector with the same philosophy as vector/deque/static_vector options. small_vector now can receive two options:

inplace_alignment: similar to your proposal, the alignment for the inplace storage can be proposed. growth_factor: the growth factor for the dynamic allocation, the same option that can be specified in vector.

Many thanks for the proposal.