//----發(fā)生了自身調(diào)用自身的錯(cuò)誤
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,的默認(rèn)operator=可以保證其內(nèi)部:子成員是POD會(huì)memcpy,子成員非POD會(huì)調(diào)用operator=