From 49bf1b3933bd4fdaab6902b0c27c4ecb6de97b61 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 15 Feb 2021 00:22:32 +0100 Subject: [PATCH] ifstream destructor closes the file, due to RAII --- inferno/src/inferno/io/file.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/inferno/src/inferno/io/file.h b/inferno/src/inferno/io/file.h index 8de201f..e6fd617 100644 --- a/inferno/src/inferno/io/file.h +++ b/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; } };