Skip to content

Instantly share code, notes, and snippets.

@chikadance
Created March 3, 2016 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chikadance/bd44e03153a499a0de62 to your computer and use it in GitHub Desktop.
Save chikadance/bd44e03153a499a0de62 to your computer and use it in GitHub Desktop.
ex
#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