ensure that all Configs are polymorphic

Tue, 20 Aug 2013 15:01:16 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 20 Aug 2013 15:01:16 +0300
changeset 463
22bdcca9f78d
parent 462
55173a35eea5
child 464
3779a14d597c

ensure that all Configs are polymorphic

src/config.cpp file | annotate | diff | comparison | revisions
src/config.h file | annotate | diff | comparison | revisions
--- a/src/config.cpp	Tue Aug 20 14:56:26 2013 +0300
+++ b/src/config.cpp	Tue Aug 20 15:01:16 2013 +0300
@@ -44,6 +44,12 @@
 #endif // PORTABLE
 }
 
+Config::Config (const char* name, const char* defstring) :
+	name (name), m_defstring (defstring)
+{
+	assert (getType() != None);
+}
+
 // =============================================================================
 // -----------------------------------------------------------------------------
 // Load the configuration from file
--- a/src/config.h	Tue Aug 20 14:56:26 2013 +0300
+++ b/src/config.h	Tue Aug 20 15:01:16 2013 +0300
@@ -47,8 +47,7 @@
 		KeySequence,
 	};
 
-	Config (const char* name, const char* defstring) :
-		name (name), m_defstring (defstring) {}
+	Config (const char* name, const char* defstring);
 	const char* name;
 
 	virtual Type getType() const {

mercurial