I am currently looking for a way in which i can split a vector into a number of smaller vectors. I am basically trying to implement a sliding window function for a vector.
> I am basically trying to implement a sliding window function for a vector.
There is no need to copy elements of the vector (or to create sub-vectors) to have a sliding window into a vector.
If the elements of the vector need not be modified via the view through the sliding window, we can use std::string_view<int> (C++17) to represent a window into the vector. http://en.cppreference.com/w/cpp/string/basic_string_view
If the elements of the vector must be modified through the sliding window, or in pre-C++17, we can roll out a windowed view of our own.