auto err = std::string{"exceptions are disabled with -fno-exceptions - attempted to throw exception with type \"" + typeid(decltype(x)).name() + "\""};
if (msg) {
err += " and the message \"" + msg + "\"";
}
Type.report_violation( err );
std::terminate();
#else
throwCPP2_FORWARD(x);
#endif
}
inlineautoUncaught_exceptions() -> int {
#ifdef CPP2_NO_EXCEPTIONS
return0;
#else
returnstd::uncaught_exceptions();
#endif
}
template<typename T>
autoDynamic_cast( [[maybe_unused]]auto&& x ) -> decltype(auto) {
#ifdef CPP2_NO_RTTI
Type.report_violation( "'as' dynamic casting is disabled with -fno-rtti" );
returnnullptr;
#else
returndynamic_cast<T>(CPP2_FORWARD(x));
#endif
}
template<typename T>
autoTypeid() -> decltype(auto) {
#ifdef CPP2_NO_RTTI
Type.report_violation( "'any' dynamic casting is disabled with -fno-rtti" );
#else
returntypeid(T);
#endif
}
autoTypeid( [[maybe_unused]]auto&& x ) -> decltype(auto) {
#ifdef CPP2_NO_RTTI
Type.report_violation( "'typeid' is disabled with -fno-rtti" );