Mark game_events::manager::execute_on_events() as noexcept

The function relies on never throwing exceptions in order for cleanup of
disabled events to work. Best to enforce that requirement.
This commit is contained in:
Jyrki Vesterinen 2018-03-10 11:49:41 +02:00
parent b6fa4740f3
commit 45cab78cfb
2 changed files with 3 additions and 2 deletions

View file

@ -117,7 +117,7 @@ void manager::write_events(config& cfg) const
wml_menu_items_.to_config(cfg);
}
void manager::execute_on_events(const std::string& event_id, manager::event_func_t func)
void manager::execute_on_events(const std::string& event_id, manager::event_func_t func) NOEXCEPT
{
const std::string standardized_event_id = event_handlers::standardize_name(event_id);
const game_data* gd = resources::gamedata;

View file

@ -17,6 +17,7 @@
#include "game_events/fwd.hpp"
#include "game_events/wmi_manager.hpp"
#include "config.hpp"
#include "global.hpp"
#include <functional>
#include <set>
@ -71,7 +72,7 @@ public:
void write_events(config& cfg) const;
using event_func_t = std::function<void(game_events::manager&, handler_ptr&)>;
void execute_on_events(const std::string& event_id, event_func_t func);
void execute_on_events(const std::string& event_id, event_func_t func) NOEXCEPT;
game_events::wml_event_pump& pump();