The Battle for Wesnoth  1.17.0-dev
make_enum.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2021
3  by Chris Beck <render787@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #include "utils/make_enum.hpp"
17 #include "wml_exception.hpp"
18 #include "game_config.hpp"
19 
21 {
22  void debug_conversion_error(const std::string& temp, const bad_enum_cast & e)
23  {
24  if (!temp.empty() && game_config::debug) {
25  FAIL( e.what() );
26  }
27  }
28 }
Add a special kind of assert to validate whether the input from WML doesn&#39;t contain any problems that...
const char * what() const noexcept
Definition: make_enum.hpp:103
const bool & debug
void debug_conversion_error(const std::string &temp, const bad_enum_cast &e)
Definition: make_enum.cpp:22
#define e
#define FAIL(message)
Defines the MAKE_ENUM macro.