Created
March 3, 2016 03:54
-
-
Save chikadance/bd44e03153a499a0de62 to your computer and use it in GitHub Desktop.
ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <exception> | |
#include "string" | |
#include "memory" | |
typedef std::string str; | |
namespace ro_err { | |
class StdErr : public std::exception { | |
public: | |
str msg; | |
StdErr(str msg) { this->msg = msg; }; | |
virtual const char *what() const override { | |
return this->msg.c_str(); | |
}; | |
}; | |
class ShErr : public StdErr { | |
public: | |
ShErr(str m) : StdErr(m) { } | |
}; | |
} | |
int main(int argc, char **argv) { | |
throw ro_err::ShErr("smth"); | |
return (0); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment