… | |
… | |
15 | using namespace std; |
15 | using namespace std; |
16 | |
16 | |
17 | /* these defines belongs into config.h */ |
17 | /* these defines belongs into config.h */ |
18 | #define abstract = 0 |
18 | #define abstract = 0 |
19 | |
19 | |
20 | #define t_no throw () |
20 | #define t_no noexcept |
21 | #define t_err throw (error) |
21 | #define t_err // can only throw error |
22 | |
22 | |
23 | inline bool equal (double a, double b) |
23 | inline bool equal (double a, double b) |
24 | { |
24 | { |
25 | return abs (a - b) <= a * 1e-6; |
25 | return abs (a - b) <= a * 1e-6; |
26 | } |
26 | } |
… | |
… | |
147 | |
147 | |
148 | ~error () t_no |
148 | ~error () t_no |
149 | { }; |
149 | { }; |
150 | |
150 | |
151 | template<typename T> |
151 | template<typename T> |
152 | error &operator <<(const T &s) const t_no |
152 | error &operator <<(const T &s) t_no |
153 | { msg.append (s); return *this; }; |
153 | { msg.append (s); return *this; }; |
154 | }; |
154 | }; |
155 | |
155 | |
156 | inline ostream &operator <<(ostream &o, const error &e) t_no |
156 | inline ostream &operator <<(ostream &o, const error &e) t_no |
157 | { return o << e.what () << endl; } |
157 | { return o << e.what () << endl; } |