From 1fbb943005ad78335f0b921be516b3df8140406d Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Sun, 4 Jun 2023 18:34:21 +0800 Subject: --- read_helper.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'read_helper.h') diff --git a/read_helper.h b/read_helper.h index f8396f2..2256ef8 100644 --- a/read_helper.h +++ b/read_helper.h @@ -65,14 +65,14 @@ public: return dst(mt19937); } - void readFile() { + bool readFile() { this->population_vector.clear(); auto read_number = 0UL; FILE *file = fopen(filename, "r"); if (file == nullptr) { fprintf(stderr, "Unable to open file %s\n", filename); - exit(1); + return false; } P_ERR("Reading sample"); @@ -98,6 +98,7 @@ public: read_number++; fclose(file); P_ERR("\r"); + return true; } void split_into(std::vector &sample, std::vector &p) { -- cgit v1.3.1