Is it safe to modify mutable members of objects inside sets?
问题 I was curious as to whether the following scenario is safe. I have the following class definitions: class ActiveStatusEffect { public: StatusEffect* effect; mutable int ReminaingTurns; ActiveStatusEffect() : ReminaingTurns(0) { } //Other unimportant stuff down here } I then store a group of these inside an std::set as follows: struct ASECmp { bool operator ()(const StatusEffects::ActiveStatusEffect &eff1, const StatusEffects::ActiveStatusEffect &eff2) { return eff1.effect->GetPriority() <