From 41ca01bd11f2f84e485d823231d7740794bd0ef5 Mon Sep 17 00:00:00 2001 From: Giulio Ermanno Pibiri Date: Thu, 6 May 2021 15:37:58 +0200 Subject: [PATCH] re-added close on destruction; non-copyable --- include/mm_file/mm_file.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/mm_file/mm_file.hpp b/include/mm_file/mm_file.hpp index 104dba4..b95031d 100644 --- a/include/mm_file/mm_file.hpp +++ b/include/mm_file/mm_file.hpp @@ -21,6 +21,13 @@ struct file { init(); } + ~file() { + close(); + } + + file(file const&) = delete; // non construction-copyable + file& operator=(file const&) = delete; // non copyable + bool is_open() const { return m_fd != -1; }