Change the range based "for (auto " to "for (auto&& ".

The latter is The Right Way of performing foreach.