std::vector::emplace_back bug when returning references (C++17)
问题 I've been trying to trace a bug for 10+ hours now, and by now I'm starting to think that the bug can't be on my side. However, I have a feeling it could be me who's just forgetting or misunderstanding something. I have a class member of type std::vector called temp_materials, and inside the constructor (when temp_materials is still empty), this code runs: Material &stonewallbug = temp_materials.emplace_back(resource_lib.get_shader("DeferredGeometryShader")); stonewallbug.set_texture("texture