]> www.ginac.de Git - ginac.git/blobdiff - check/error_report.hpp
expairseq::match(): remove the code which works around basic::match bug.
[ginac.git] / check / error_report.hpp
diff --git a/check/error_report.hpp b/check/error_report.hpp
new file mode 100644 (file)
index 0000000..6b2dfe6
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef GINAC_CHECK_ERROR_REPORT_HPP
+#define GINAC_CHECK_ERROR_REPORT_HPP
+#include <sstream>
+#include <stdexcept>
+
+#define bug_on(cond, what)                             \
+do {                                                   \
+if (cond) {                                            \
+       std::ostringstream err_stream;                  \
+       err_stream << __FILE__ << ':' << __LINE__       \
+                  << what;                             \
+       throw std::logic_error(err_stream.str());       \
+}                                                      \
+} while (0)
+
+#endif // GINAC_CHECK_ERROR_REPORT_HPP
+