Skip to content

Add constexpr_vector class#415

Merged
gumb0 merged 2 commits intomasterfrom
constexpr-vector
Jul 9, 2020
Merged

Add constexpr_vector class#415
gumb0 merged 2 commits intomasterfrom
constexpr-vector

Conversation

@gumb0
Copy link
Collaborator

@gumb0 gumb0 commented Jul 8, 2020

Required for #403

@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #415 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #415   +/-   ##
=======================================
  Coverage   99.17%   99.17%           
=======================================
  Files          47       49    +2     
  Lines       13189    13232   +43     
=======================================
+ Hits        13080    13123   +43     
  Misses        109      109           

@gumb0 gumb0 force-pushed the constexpr-vector branch from 03e9e42 to d456e54 Compare July 8, 2020 14:04
@gumb0 gumb0 marked this pull request as ready for review July 8, 2020 14:05
Copy link
Member

@axic axic left a 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.

@gumb0 gumb0 force-pushed the constexpr-vector branch from d456e54 to 3028948 Compare July 8, 2020 14:16
@gumb0 gumb0 requested a review from chfast July 8, 2020 14:17
Copy link
Collaborator

@chfast chfast left a 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.

/// 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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
template <typename T, std::size_t MaxSize>
template <typename T, std::size_t MaxCapacity>

Or just Capacity.

Copy link
Collaborator Author

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
Copy link
Collaborator

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

@gumb0 gumb0 force-pushed the constexpr-vector branch from 3028948 to ff17e43 Compare July 9, 2020 12:22
@gumb0 gumb0 merged commit b0a4822 into master Jul 9, 2020
@gumb0 gumb0 deleted the constexpr-vector branch July 9, 2020 12:34
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

Successfully merging this pull request may close these issues.

3 participants