ifstream destructor closes the file, due to RAII

This commit is contained in:
Riyyi
2021-02-15 00:22:32 +01:00
parent 16cebbb8cb
commit 49bf1b3933
-4
View File
@@ -32,11 +32,9 @@ namespace Inferno {
file >> *t;
}
catch (...) {
file.close();
return false;
}
file.close();
return true;
}
@@ -55,11 +53,9 @@ namespace Inferno {
file << std::setfill ('\t') << std::setw(1) << *t << std::endl;
}
catch (...) {
file.close();
return false;
}
file.close();
return true;
}
};