2
typedef struct {
guint8 mode;
vector <string> match_src;
} structConfig_t;
map < guint64, vector <structConfig_t> > mapConfig_t;
期間內存釋放用於地圖數據成員在類,然後讓類如下是例外
class Config {
private :
mapConfig_t mapConfig;
public :
Config(const char * config_fn) throw (string);
}
構造解析爲「config_fn」的文件中的每一行,並建立mapConfig數據結構。在解析問題上,構造函數引發異常。
好奇的是,如果解析失敗的文件並引發異常,並且mapConfig有數據 被解析到現在會發生什麼,mapConfig會使用內存直到然後在這種情況下自動放棄?