mail[Wesnoth-commits] r44986 - /trunk/src/game_errors.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on July 31, 2010 - 12:52:
Author: silene
Date: Sat Jul 31 12:52:12 2010
New Revision: 44986

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44986&view=rev
Log:
Inherited from standard exception.

Modified:
    trunk/src/game_errors.hpp

Modified: trunk/src/game_errors.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_errors.hpp?rev=44986&r1=44985&r2=44986&view=diff
==============================================================================
--- trunk/src/game_errors.hpp (original)
+++ trunk/src/game_errors.hpp Sat Jul 31 12:52:12 2010
@@ -15,17 +15,26 @@
 #ifndef GAME_ERRORS_HPP_INCLUDED
 #define GAME_ERRORS_HPP_INCLUDED
 
+#include <exception>
 #include <string>
 
 namespace game {
-struct error {
+
+struct error : std::exception
+{
+       std::string message;
+
        error() :
                message()
                {}
        error(const std::string& msg) : message(msg)
        {}
+       ~error() throw() {}
 
-       std::string message;
+       const char *what() const throw()
+       {
+               return message.c_str();
+       }
 };
 
 struct mp_server_error : public error {




Related Messages


Powered by MHonArc, Updated Sat Jul 31 13:00:15 2010