Closed erisco closed 13 years ago
Persistent reference of temporary variable in CollisionManager::GetCandidateList may fail to compile.
Offending code:
class GetCandidateList { public: // empty constructor GetCandidateList() : _target(PhysicalEntity()) { } // ... snipped ... private: PhysicalEntity &_target; };
This happened to Jeff using clang, whereas in VS10 only a compiler warning is produced. GCC is untested.
In any case, the compilers are right to complain as it is an unsafe practice.
Possible alternatives:
Empty constructor was actually not needed, so it was removed in e0ab860
Persistent reference of temporary variable in CollisionManager::GetCandidateList may fail to compile.
Offending code:
This happened to Jeff using clang, whereas in VS10 only a compiler warning is produced. GCC is untested.
In any case, the compilers are right to complain as it is an unsafe practice.
Possible alternatives: