mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-06 02:36:18 +08:00
Place after open
This commit is contained in:
@@ -14,10 +14,10 @@ Result<Nothing> save_string(const std::string& _fname, const T& _obj,
|
||||
const WriteFunction& _write) {
|
||||
try {
|
||||
std::ofstream outfile;
|
||||
outfile.open(_fname);
|
||||
if (!outfile.is_open()) {
|
||||
return error("Unable to open file '" + _fname + "' for writing.");
|
||||
}
|
||||
outfile.open(_fname);
|
||||
_write(_obj, outfile);
|
||||
outfile.close();
|
||||
} catch (std::exception& e) {
|
||||
|
||||
Reference in New Issue
Block a user