//----發生了自身調用自身的錯誤
struct ToleranceOverrideExc
{
ToleranceOverride rule_data;
set<SymbolTolerancePoint> symbol_points;
ToleranceOverrideExc(){memset(&rule_data, 0, sizeof(ToleranceOverride));}
ToleranceOverrideExc(const ToleranceOverride& tol_ovr){rule_data= tol_ovr;}
ToleranceOverrideExc(const ToleranceOverrideExc& other){*this= other;}
ToleranceOverrideExc& operator=(const ToleranceOverrideExc& other){*this= other;return *this;}
operator ToleranceOverride(){return rule_data;}
void SetValue(ToleranceOverride& save){rule_data= save;symbol_points.clear();}
};
備忘:
struct POD,的默認operator=可以保證其內部:子成員是POD會memcpy,子成員非POD會調用operator=