Exemplo n.º 1
0
    template <typename E> HPX_NORETURN
    void throw_with_info(E&& e, exception_info&& xi = exception_info())
    {
        using ED = typename std::decay<E>::type;
        static_assert(
#if defined(HPX_HAVE_CXX14_STD_IS_FINAL)
            std::is_class<ED>::value && !std::is_final<ED>::value,
#else
            std::is_class<ED>::value,
#endif
            "E shall be a valid base class");
        static_assert(
            !std::is_base_of<exception_info, ED>::value,
            "E shall not derive from exception_info");

        throw detail::exception_with_info<ED>(std::forward<E>(e), std::move(xi));
    }
Exemplo n.º 2
0
BOOL __cdecl _CallSETranslator(
    EHExceptionRecord   *pExcept,    // The exception to be translated
    EHRegistrationNode  *pRN,        // Dynamic info of function with catch
    CONTEXT             *pContext,   // Context info
    DispatcherContext   *pDC,        // More dynamic info of function with catch (ignored)
    FuncInfo            *pFuncInfo,  // Static info of function with catch
    ULONG               CatchDepth,  // How deeply nested in catch blocks are we?
    EHRegistrationNode  *pMarkerRN   // Marker for parent context
) {
    UNREFERENCED_PARAMETER(pMarkerRN);

    BOOL result = FALSE;
    pRN;
    pDC;
    pFuncInfo;
    CatchDepth;

    // Call the translator.

    _EXCEPTION_POINTERS excptr = { (PEXCEPTION_RECORD)pExcept, pContext };

    __try {
        _se_translator_function pSETranslator;
        pSETranslator = __pSETranslator;
        pSETranslator(PER_CODE(pExcept), &excptr);
        result = FALSE;
    } __except(__SehTransFilter( exception_info(),
                                 pExcept,
                                 pRN,
                                 pContext,
                                 pDC,
                                 pFuncInfo,
                                 &result
                                )) {}

    // If we got back, then we were unable to translate it.

    return result;
}
Exemplo n.º 3
0
 template <typename E> HPX_NORETURN
 void throw_with_info(E&& e, exception_info const& xi)
 {
     throw_with_info(std::forward<E>(e), exception_info(xi));
 }