From 550d211aa1c60631d95c2bd3993f813269f3b34b Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 27 May 2020 23:41:44 +0100 Subject: [PATCH] i dunno --- main.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 1f72ad1..6443ba5 100644 --- a/main.cpp +++ b/main.cpp @@ -138,15 +138,22 @@ const unsigned char* get_data(int i) template struct DirTree { + bool clean=true; const Path path; - DirTree(const Path input): path(input) + DirTree(const Path input) noexcept : path(input) { - fs::create_directory(input); + fs::create_directory(path); } + DirTree(DirTree&& other) noexcept : path(other.path) + { + other.clean=false; + } + DirTree(const DirTree& _) noexcept = delete; ~DirTree() { - fs::remove_all(path); + if(clean) + fs::remove_all(path); } const Path& operator &()