ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/lsys/util.h
(Generate patch)

Comparing lsys/util.h (file contents):
Revision 1.1 by root, Thu Nov 6 14:31:24 2008 UTC vs.
Revision 1.2 by root, Wed Nov 7 12:50:17 2018 UTC

15using namespace std; 15using 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
23inline bool equal (double a, double b) 23inline 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
156inline ostream &operator <<(ostream &o, const error &e) t_no 156inline ostream &operator <<(ostream &o, const error &e) t_no
157 { return o << e.what () << endl; } 157 { return o << e.what () << endl; }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines