I\'ve got a std::list in C++ and I\'m trying to use a for(Type t : list) operation to update the value of each object. So I have a list called balls a
std::list
for(Type t : list)
You're taking a copy of original object, use a reference
for(OpenGLView::AssetInstance& ball : balls) ball.position = calculateBallPosition(ball);
Or Simply
for( auto& ball : balls) ball.position = calculateBallPosition(ball);