for loop syntax with containers - Is a copy made?

Viewed 111

I am reading about the new C++11 syntax for iterating over STL containers. So far I came across the following example:

std::vector<int> plus;
....
for(int l : plus)
{
std::cout << l;
}     

My question is does the above syntax make a copy of the int ? If so wouldnt this be more efficient ?:

for(int& l : plus)
3 Answers
Related