diff --git a/openVulkanoCpp/Base/Event.hpp b/openVulkanoCpp/Base/Event.hpp index 5224a70..a547e88 100644 --- a/openVulkanoCpp/Base/Event.hpp +++ b/openVulkanoCpp/Base/Event.hpp @@ -227,12 +227,30 @@ namespace OpenVulkano {} void Notify(Arguments... args) const override + { + NotifyImpl(std::forward(args)...); + } + + void NotifyImpl(Arguments... args) const { if (INamedEventProcessor::HasProcessor()) { std::vector attributes; attributes.reserve(sizeof...(Arguments)); - (attributes.emplace_back(args), ...); + if constexpr (!std::conjunction_v>...>) + { + (attributes.emplace_back(args), ...); + } + else + { + auto fill = [&](auto&& arg) { + if constexpr (std::is_enum_v>) + attributes.emplace_back(static_cast(arg)); + else + attributes.emplace_back(std::forward(arg)); + }; + (fill(std::forward(args)), ...); + } INamedEventProcessor::NotifyAll(m_name, attributes); } }