Deliberately I\'m having this method which writes into a file, so I tried to handle the exception of the possiblity that I\'m writing into a closed file:
void pr
consider following:
void printMe(ofstream& file) { file.exceptions(std::ofstream::badbit | std::ofstream::failbit); try { file << "\t"+m_Type+"\t"+m_Id";"+"\n"; } catch (std::ofstream::failure &e) { std::cerr << e.what() << std::endl; } };