Reference vs. copy in a range-based for loop
Understanding the difference between using a reference or a copy of a value is critically important in C++. By default, when we pass a value to a function, it is passed by values, which means we pass a copy of it. The same applied to a for...