I want to restrict vector to be unchanged. In following code when i use reference for each loop and increment each value, same is reflected in the vector. But I want to avoid.
#include <vector>
#include <iostream>
int main()
{
std::vector<int> port = {8, 0, 8, 0};
for (auto &digit: port){
digit++;
std::cout << digit << std::endl;
}
}