Added raise_error free function that will either throw the error (if ETL_THROW_EXCEPTIONS is defined) or call error_handler::error.

This commit is contained in:
John Wellbelove 2015-08-19 14:36:18 +01:00
parent 13c024bd9c
commit 779e313e11

View File

@ -78,6 +78,21 @@ namespace etl
static ifunction<const exception&>* p_ifunction;
};
//***************************************************************************
/// Raise an error.
/// If ETL_THROW_EXCEPTIONS is defined then the error is thrown, otherwise
/// the error handler is called.
///\ingroup error_handler
//***************************************************************************
inline void raise_error(const exception& e)
{
#ifdef ETL_THROW_EXCEPTIONS
throw e;
#else
error_handler::error(e);
#endif
}
}
#endif