Remove noexcept from delegate method stubs. (#1185)

In addition to removing noexcept from call_if, this is also needed to prevent
an abort when cancelling a pthread that is executing a delegate.
This commit is contained in:
Marco Nilsson 2025-09-13 09:23:15 +02:00 committed by John Wellbelove
parent f5bdca7216
commit 9f7e4abd42

View File

@ -583,7 +583,7 @@ namespace etl
/// Stub call for a member function. Run time instance.
//*************************************************************************
template <typename T, TReturn(T::*Method)(TParams...)>
static ETL_CONSTEXPR14 TReturn method_stub(void* object, TParams... params) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
static ETL_CONSTEXPR14 TReturn method_stub(void* object, TParams... params)
{
T* p = static_cast<T*>(object);
return (p->*Method)(etl::forward<TParams>(params)...);
@ -593,7 +593,7 @@ namespace etl
/// Stub call for a const member function. Run time instance.
//*************************************************************************
template <typename T, TReturn(T::*Method)(TParams...) const>
static ETL_CONSTEXPR14 TReturn const_method_stub(void* object, TParams... params) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
static ETL_CONSTEXPR14 TReturn const_method_stub(void* object, TParams... params)
{
T* const p = static_cast<T*>(object);
return (p->*Method)(etl::forward<TParams>(params)...);
@ -603,7 +603,7 @@ namespace etl
/// Stub call for a member function. Compile time instance.
//*************************************************************************
template <typename T, TReturn(T::*Method)(TParams...), T& Instance>
static ETL_CONSTEXPR14 TReturn method_instance_stub(void*, TParams... params) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
static ETL_CONSTEXPR14 TReturn method_instance_stub(void*, TParams... params)
{
return (Instance.*Method)(etl::forward<TParams>(params)...);
}
@ -612,7 +612,7 @@ namespace etl
/// Stub call for a const member function. Compile time instance.
//*************************************************************************
template <typename T, TReturn(T::*Method)(TParams...) const, const T& Instance>
static ETL_CONSTEXPR14 TReturn const_method_instance_stub(void*, TParams... params) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
static ETL_CONSTEXPR14 TReturn const_method_instance_stub(void*, TParams... params)
{
return (Instance.*Method)(etl::forward<TParams>(params)...);
}
@ -622,7 +622,7 @@ namespace etl
/// Stub call for a function operator. Compile time instance.
//*************************************************************************
template <typename T, T& Instance>
static ETL_CONSTEXPR14 TReturn operator_instance_stub(void*, TParams... params) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
static ETL_CONSTEXPR14 TReturn operator_instance_stub(void*, TParams... params)
{
return Instance.operator()(etl::forward<TParams>(params)...);
}
@ -632,7 +632,7 @@ namespace etl
/// Stub call for a free function.
//*************************************************************************
template <TReturn(*Method)(TParams...)>
static ETL_CONSTEXPR14 TReturn function_stub(void*, TParams... params) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
static ETL_CONSTEXPR14 TReturn function_stub(void*, TParams... params)
{
return (Method)(etl::forward<TParams>(params)...);
}
@ -641,7 +641,7 @@ namespace etl
/// Stub call for a lambda or functor function.
//*************************************************************************
template <typename TLambda>
static ETL_CONSTEXPR14 TReturn lambda_stub(void* object, TParams... arg) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
static ETL_CONSTEXPR14 TReturn lambda_stub(void* object, TParams... arg)
{
TLambda* p = static_cast<TLambda*>(object);
return (p->operator())(etl::forward<TParams>(arg)...);
@ -651,7 +651,7 @@ namespace etl
/// Stub call for a const lambda or functor function.
//*************************************************************************
template <typename TLambda>
static ETL_CONSTEXPR14 TReturn const_lambda_stub(void* object, TParams... arg) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
static ETL_CONSTEXPR14 TReturn const_lambda_stub(void* object, TParams... arg)
{
const TLambda* p = static_cast<const TLambda*>(object);
return (p->operator())(etl::forward<TParams>(arg)...);