1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-27 03:47:40 +00:00

Rationalize some std::exception stuff.

This commit is contained in:
Arthur O'Dwyer
2021-03-21 17:56:38 -04:00
parent 4c10b17b7e
commit 1761b02b90
8 changed files with 32 additions and 34 deletions

12
hyper.h
View File

@@ -98,14 +98,12 @@ using std::asinh;
using std::acosh;
#endif
struct hr_exception: std::exception { hr_exception() {} };
struct hr_shortest_path_exception: hr_exception { };
struct hr_exception : std::runtime_error {
explicit hr_exception() : std::runtime_error("hr_exception") {}
explicit hr_exception(const std::string& s) : std::runtime_error(s.c_str()) {}
};
struct hr_wrong_dir: hr_exception { };
struct hr_wrong_geometry: hr_exception { };
struct hr_exception_str: std::exception { string s; hr_exception_str(const string& s) : s(s) {} const char* what() { return s.c_str(); }};
struct hr_shortest_path_exception { };
// genus (in grammar)
#define GEN_M 0