00001
00014 #ifndef _ERROR_H
00015 #define _ERROR_H
00016
00017 #include <iostream>
00018 #include <string>
00019
00020 namespace xchen
00021 {
00022 template<bool> struct CompileTimeError;
00023 template<> struct CompileTimeError<false> { };
00024 #define ERR(XPR, MSG) { CompileTimeError<(XPR)> vectorERROR_##MSG; }
00025
00026 inline void RUN_ERR(const std::string& msg) { std::cerr << msg; exit(0); }
00027
00028
00029 inline void error_exit(std::string const& msg)
00030 {
00031 std::cerr << msg;
00032 exit(0);
00033 }
00034
00035 }
00036
00037
00038 #endif