I'm trying to splice a vector in C++ using the following code:
sequence(sequence.begin() + i, sequence.end());
where sequence
is a vector containing integers and i
is an integer, but when I run my code it gives the following error:
error: no match for call to ‘(std::vector<int>) (__gnu_cxx::__normal_iterator<int*,
std::vector<int> >, std::vector<int>::iterator)’
sequence(sequence.begin() + i, sequence.end());
^
I don't understand what is wrong with my code. I used the following stack overflow questions to help write this code: