#include<vector>
#include<iostream>
#include<algorithm>

int main() {
	std::vector<int> values{0, 10, 20, 30, 40, 50, 60, 70, 80, 90};
	std::vector<size_t> indexes_to_move{2,4};
	size_t destination_index = 6;
	if(destination_index > values.size()) throw std::runtime_error("Come on, bro.");
	
	for(auto const& val : values) std::cout << val << ',';
	std::cout << std::endl;
	
	for(size_t _index = 0; _index < indexes_to_move.size(); _index++) {
		size_t index = indexes_to_move[indexes_to_move.size() - _index - 1]; //We need to iterate in reverse.
		if(index >= values.size()) throw std::runtime_error("We dun goofed.");
		if(index >= destination_index) throw std::runtime_error("We goofed in a different way.");
		
		std::rotate(values.begin() + index, values.begin() + index + 1, values.begin() + destination_index);
		destination_index--;
	}
	
	for(auto const& val : values) std::cout << val << ',';
	std::cout << std::endl;
	return 0;
}