From 4b38c62c95b29c2d539213ad6740147ef0080e9b Mon Sep 17 00:00:00 2001 From: marc Date: Thu, 2 Mar 2000 05:48:23 +0000 Subject: [PATCH] Something went wrong with past commit's. So, again - added the virtual destructors of all classes, to suppress g++ annoying warnings when using -Wall option --- eo/src/eoException.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eo/src/eoException.h b/eo/src/eoException.h index 96203594..31c09599 100644 --- a/eo/src/eoException.h +++ b/eo/src/eoException.h @@ -32,11 +32,11 @@ #include "eoObject.h" -struct eoException +struct eoException { eoException() {} eoException(const eoObject& caller) : who_caught_it(caller.className()) {} - + virtual ~eoException(){} // otherwise compiler complains std::string who(void) const { return who_caught_it; } virtual std::string what(void) const{ return "";} @@ -48,6 +48,7 @@ struct eoFitnessException : public eoException { eoFitnessException() : eoException() {} eoFitnessException(const eoObject& caller) : eoException(caller) {} + virtual ~eoFitnessException(){} // otherwise compiler complains }; struct eoNegativeFitnessException : public eoFitnessException @@ -55,6 +56,7 @@ struct eoNegativeFitnessException : public eoFitnessException eoNegativeFitnessException() : eoFitnessException() {} eoNegativeFitnessException(const eoObject& caller) : eoFitnessException(caller) {} + virtual ~eoNegativeFitnessException(){} // otherwise compiler complains std::string what(void) const { return "negative fitness encountered"; } }; @@ -62,6 +64,7 @@ struct eoMinimizingFitnessException : public eoFitnessException { eoMinimizingFitnessException() : eoFitnessException() {} eoMinimizingFitnessException(const eoObject& caller) : eoFitnessException(caller) {} + virtual ~eoMinimizingFitnessException(){} // otherwise compiler complains std::string what(void) const { return "smaller fitness is better fitness, which is quite inappropriate here"; } };