gnzlbg / static_vector

A dynamically-resizable vector with fixed capacity and embedded storage
https://gnzlbg.github.io/static_vector
167 stars 21 forks source link

Add alternative section on using a `std::with_size` tag. #15

Closed gnzlbg closed 7 years ago

gnzlbg commented 8 years ago

See @akrzemi1 blog post: the cost of std::initializer_list.

Probably need to keep the current API for compatibility with std::vector, but add a section with an "alternative" proposal that uses tags with_size (for inline_vector(with_size, N)).

I don't think we need a tag from_range for inline_vector(from_range, begin, end), since the iterators will have different types and we can sfinae on that, but need to study this and see if this is can be a problem.

Comment also on how this helps with the constexpr implementation since making the std::initializer_list constructor constexpr is a true pain point.