summaryrefslogtreecommitdiff
path: root/src/fileio_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileio_func.h')
-rw-r--r--src/fileio_func.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fileio_func.h b/src/fileio_func.h
index dec193193..d95131880 100644
--- a/src/fileio_func.h
+++ b/src/fileio_func.h
@@ -159,4 +159,12 @@ public:
}
};
+/** Helper to manage a FILE with a \c std::unique_ptr. */
+struct FileDeleter {
+ void operator()(FILE *f)
+ {
+ if (f) fclose(f);
+ }
+};
+
#endif /* FILEIO_FUNC_H */