63 int pos; |
63 int pos; |
64 }; |
64 }; |
65 |
65 |
66 // ============================================================================= |
66 // ============================================================================= |
67 // |
67 // |
68 class ScriptError : public std::exception |
|
69 { |
|
70 public: |
|
71 ScriptError (const String& msg) : |
|
72 mMsg (msg) {} |
|
73 |
|
74 inline const char* what() const throw() |
|
75 { |
|
76 return mMsg; |
|
77 } |
|
78 |
|
79 private: |
|
80 String mMsg; |
|
81 }; |
|
82 |
|
83 // ============================================================================= |
|
84 // |
|
85 // Get absolute value of @a |
68 // Get absolute value of @a |
86 // |
69 // |
87 template<class T> inline T abs (T a) |
70 template<class T> inline T abs (T a) |
88 { |
71 { |
89 return (a >= 0) ? a : -a; |
72 return (a >= 0) ? a : -a; |