-
Notifications
You must be signed in to change notification settings - Fork 34
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 constexpr_vector class #415
Conversation
Codecov Report
@@ Coverage Diff @@
## master #415 +/- ##
=======================================
Coverage 99.17% 99.17%
=======================================
Files 47 49 +2
Lines 13189 13232 +43
=======================================
+ Hits 13080 13123 +43
Misses 109 109 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay to me, but would wait for @chfast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end I think it is fine to have it.
lib/fizzy/constexpr_vector.hpp
Outdated
/// It allows to have a collection (constexpr array) of such lists, where list lengths vary across | ||
/// the collection, but each length is still known at compile time (and doesn't exceed MaxSize | ||
/// limit). | ||
template <typename T, std::size_t MaxSize> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template <typename T, std::size_t MaxSize> | |
template <typename T, std::size_t MaxCapacity> |
Or just Capacity
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to Capacity
/// the collection, but each length is still known at compile time (and doesn't exceed MaxSize | ||
/// limit). | ||
template <typename T, std::size_t MaxSize> | ||
class constexpr_vector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be also named static_vector
as in https://github.com/gnzlbg/static_vector#3-existing-practice.
Also found a precedence of constexpr_vector
: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0597r0.html
Required for #403