added default constructor

This commit is contained in:
Jorijn van der Graaf 2025-11-25 02:07:05 +01:00
commit 7078bcf5ba

View file

@ -1,12 +1,11 @@
/*
Crafter®.Event
Copyright (C) 2025 Catcrafts®
Catcrafts.net
catcrafts.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
License version 3.0 as published by the Free Software Foundation;
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -60,6 +59,7 @@ namespace Crafter {
class Event {
public:
std::map<int, std::vector<EventListener<T>*>> listeners;
Event() = default;
Event(Event&& other) : listeners(std::move(other.listeners)) {
for (const auto& listenerSlice : listeners) {
for (const auto& listener : listenerSlice.second) {
@ -128,6 +128,7 @@ namespace Crafter {
class Event<void> {
public:
std::map<int, std::vector<EventListener<void>*>> listeners;
Event() = default;
Event(Event&& other) : listeners(std::move(other.listeners)) {
for (const auto& listenerSlice : listeners) {
for (const auto& listener : listenerSlice.second) {