22 #ifndef GUARD_EXCEPTIONS_H 23 #define GUARD_EXCEPTIONS_H 28 template<
class T,
class E> E
37 catch (std::bad_alloc &e)
41 catch (std::exception &e)
44 std::cerr <<
"----------------------------------------" <<
'\n';
45 std::cerr <<
"- Standard Exception Caught -" <<
'\n';
46 std::cerr <<
"----------------------------------------" <<
'\n';
47 std::cerr << e.what() <<
'\n';
52 std::cerr <<
"----------------------------------------" <<
'\n';
53 std::cerr <<
"- Unknown Exception Caught -" <<
'\n';
54 std::cerr <<
"----------------------------------------" <<
'\n';
60 template<
class T>
void
E guard_exceptions(E error_code, T func)