Consider the following code:
考虑下面的代码:
ifstream in;
try {
in.exceptions ( ifstream::failbit | ifstream::badbit );
in.open(pConfLocation);
} catch ( ifstream::failure e ) {
throw std::runtime_error("Can't open configuration file\n");
}
vector<string> lns;
string s;
in.clear();
while ( !in.eof() ){
getline( in, s );
boost::algorithm::trim(s);
lns.push_back( s+='\n');
}
i