diff options
| author | KunoiSayami <[email protected]> | 2023-06-04 18:34:21 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2023-06-04 18:34:21 +0800 |
| commit | 1fbb943005ad78335f0b921be516b3df8140406d (patch) | |
| tree | 454d384ed2566a907b11be57a6b7e49ddbc74605 /read_helper.h | |
| parent | d8384bdc4aa7fa1ccc24aec296fac83f1d43a2b4 (diff) | |
Diffstat (limited to 'read_helper.h')
| -rw-r--r-- | read_helper.h | 5 |
1 files changed, 3 insertions, 2 deletions
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<key_type> &sample, std::vector<key_type> &p) { |
