ifstream destructor closes the file, due to RAII
This commit is contained in:
@@ -32,11 +32,9 @@ namespace Inferno {
|
|||||||
file >> *t;
|
file >> *t;
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
file.close();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,11 +53,9 @@ namespace Inferno {
|
|||||||
file << std::setfill ('\t') << std::setw(1) << *t << std::endl;
|
file << std::setfill ('\t') << std::setw(1) << *t << std::endl;
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
file.close();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.close();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user