MGIS
Loading...
Searching...
No Matches
Raise.hxx File Reference

declaration of the raise function. More...

#include <utility>
#include <stdexcept>
#include "MGIS/Config.hxx"
#include "MGIS/Raise.ixx"

Namespaces

namespace  mgis
 the namespace mgis encloses all the MGIS project.
 

Typedefs

using mgis::ExceptionHandler = void(*)(void)
 a simple alias
 

Functions

MGIS_EXPORT void mgis::setExceptionHandler (ExceptionHandler)
 set an exception handler
 
MGIS_EXPORT ExceptionHandler mgis::getExceptionHandler ()
 return a registred exception handler, nullptr if none were registred.
 
template<typename Exception = std::runtime_error>
MGIS_VISIBILITY_LOCAL void mgis::raise ()
 a small wrapper used to build the exception outside the throw statement. As most exception's classes constructors may throw, this avoids undefined behaviour as reported by the cert-err60-cpp warning of clang-tidy (thrown exception type is not nothrow copy constructible).
 
template<typename Exception = std::runtime_error, typename... Args>
MGIS_VISIBILITY_LOCAL void mgis::raise (Args &&...)
 a small wrapper used to build the exception outside the throw statement. As most exception's classes constructors may throw, this avoids undefined behaviour as reported by the cert-err60-cpp warning of clang-tidy (thrown exception type is not nothrow copy constructible).
 
template<typename Exception = std::runtime_error>
MGIS_VISIBILITY_LOCAL void mgis::raise_if (const bool)
 raise an exception if the first argument is true.
 
template<typename Exception = std::runtime_error, typename... Args>
MGIS_VISIBILITY_LOCAL void mgis::raise_if (const bool, Args &&...)
 raise an exception if the first argument is true.
 

Detailed Description

declaration of the raise function.

Author
Thomas Helfer
Date
20/06/2018