Moved the Mandatory WML child exception...

...back into the object file where it belongs.  It is faster to attach
a breakpoint to, because it isn't inline.
This commit is contained in:
Thonsew 2011-09-15 20:16:57 +00:00
parent 38c351d523
commit 28e92236ca
2 changed files with 12 additions and 5 deletions

View file

@ -30,7 +30,6 @@
#include <cstdlib>
#include <cstring>
#include <deque>
#include <boost/variant.hpp>
#ifdef DEBUG
#include "utils/count_logger.hpp"
@ -289,6 +288,8 @@ bool config::initialize_invalid() {
return true;
}
void config::throw_missing_child_exception() const {
throw error("Mandatory WML child missing yet untested for. Please report."); }
config::config() : values(), children(), ordered_children() {
//Run initialization once

View file

@ -35,7 +35,6 @@
#include <iosfwd>
#include <vector>
#include <utility> //for relops
#include <boost/variant/variant.hpp>
#include <boost/unordered_map.hpp>
#include "game_errors.hpp"
@ -60,18 +59,25 @@ class config
static config * invalid;
static bool initialize_invalid();
/**
* Raises a most cryptic exception if @a this is not valid.
*/
//Place the call to the exception in the object file.
void throw_missing_child_exception() const ;
/**
* Raises an exception if @a this is not valid.
*/
void check_valid() const {
if (!*this){
throw error("Mandatory WML child missing yet untested for. Please report."); }
}
throw_missing_child_exception(); }}
/**
* Raises an exception if @a this or @a cfg is not valid.
*/
void check_valid(const config &cfg) const {check_valid(); cfg.check_valid();}
void check_valid(const config &cfg) const {
check_valid();
cfg.check_valid();}
#ifndef HAVE_CXX0X
struct safe_bool_impl { void nonnull() {} };