Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for stored_size option in static_vector and small_vector #284

Open
Lastique opened this issue Jul 8, 2024 · 1 comment
Open

Comments

@Lastique
Copy link
Member

Lastique commented Jul 8, 2024

Both static_vector and small_vector could benefit from supporting the stored_size option that is supported by the base vector container. static_vector and small_vector are usually used for small numbers of elements, and it makes sense to be able to use a smaller type to store the number of elements in the container.

Also, just as an additional idea, static_vector could automatically use a smaller size type depending on the magnitude of the specified capacity. But my main request is still the support for explicit stored_size option.

@Lastique
Copy link
Member Author

Lastique commented Jul 8, 2024

BTW, there is a documentation bug:

//! Supported options are: \c boost::container::growth_factor and \c boost::container::stored_size

here it says stored_size is supported, but it actually is not:

typedef small_vector_opt< typename packed_options::growth_factor_type
, packed_options::inplace_alignment> implementation_defined;

stored_size is also not listed as supported in the QuickBook documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant