core: (fixes #1052) silence maybe-uninitialized warning in gcc 13.1

This commit is contained in:
Tommaso Pecorella
2024-03-25 21:44:49 +01:00
parent 41921f6e81
commit fa5c41b30f

View File

@@ -19,6 +19,8 @@
#ifndef MAKE_EVENT_H
#define MAKE_EVENT_H
#include "warnings.h"
#include <type_traits>
/**
@@ -142,6 +144,8 @@ MakeEvent(MEM mem_ptr, OBJ obj, Ts... args)
class EventMemberImpl : public EventImpl
{
public:
EventMemberImpl() = delete;
EventMemberImpl(OBJ obj, MEM function, Ts... args)
: m_obj(obj),
m_function(function),
@@ -157,12 +161,14 @@ MakeEvent(MEM mem_ptr, OBJ obj, Ts... args)
private:
void Notify() override
{
NS_WARNING_PUSH_MAYBE_UNINITIALIZED;
std::apply(
[this](Ts... args) {
(internal::EventMemberImplObjTraits<OBJ>::GetReference(m_obj).*
m_function)(args...);
},
m_arguments);
NS_WARNING_POP;
}
OBJ m_obj;