Browse Source

ifstream destructor closes the file, due to RAII

master
Riyyi 4 years ago
parent
commit
49bf1b3933
  1. 4
      inferno/src/inferno/io/file.h

4
inferno/src/inferno/io/file.h

@ -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;
}
};

Loading…
Cancel
Save