for(auto it = entities.begin(); it != entities.end(); ++it) {
TexturedModel& texturedModel = it->first; /*here it gives an error because it->first returns a "const &" and not a reference.
}
You can get a 'const TexturedModel &', but not a 'TexturedModel &'. Keys in a map cannot be modified because that would allow you to modify them in a way that changes their ordering in the map, invalidating it.