Skip to content

Commit fef97f8

Browse files
author
Thumperrr
committed
fixed up chesspp::exception to inherit std::exception.
1 parent 0880371 commit fef97f8

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/Exception.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22
#define _EXCEPTION_H
33

44
#include <string>
5+
#include <exception>
56

67
namespace chesspp
78
{
8-
class exception
9-
{
10-
protected:
11-
exception &operator=(const exception &) throw();
12-
9+
class exception : public std::exception
10+
{
1311
public:
1412
exception() throw() {}
15-
exception(const std::string &_e) throw() : e(_e) {}
16-
exception(const exception &) throw() {}
1713
virtual ~exception() throw() {};
14+
exception(const exception &) throw() {}
1815

19-
virtual std::string what() const throw() {return e;}
16+
exception(const std::string &_e) throw() : e(_e) {}
17+
virtual const char *what() { return e.c_str(); }
18+
2019
private:
2120
std::string e;
2221
};

0 commit comments

Comments
 (0)