Skip to content

Deseralizing a custom Vec class #501

Answered by stephenberry
fluxehub asked this question in Q&A
Discussion options

You must be logged in to vote

For a static vector like this, I think you just need to satisfy this concept:

template <class T>
   concept range = requires(T& t) {
                      requires !std::same_as<void, decltype(t.begin())>;
                      requires !std::same_as<void, decltype(t.end())>;
                      requires std::input_iterator<decltype(t.begin())>;
                   };

So, you need begin and end iterators to your vector.

You could just return the iterators from the std::array you are using.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fluxehub
Comment options

Answer selected by fluxehub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants