⚗️ try minimal example

This commit is contained in:
Niels Lohmann 2021-08-10 08:35:14 +02:00
parent 0d530c9de8
commit edc203a837
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69

View File

@ -76,11 +76,6 @@ class exception : public std::exception
protected: protected:
exception(const char* what_arg) : m(what_arg) {} exception(const char* what_arg) : m(what_arg) {}
static std::string name(const std::string& ename)
{
return "[json.exception." + ename + "] ";
}
private: private:
std::runtime_error m; std::runtime_error m;
}; };
@ -90,14 +85,12 @@ class parse_error : public exception
public: public:
static parse_error create(const std::string& what_arg) static parse_error create(const std::string& what_arg)
{ {
std::string w = exception::name("parse_error") + what_arg; std::string w = "[json.exception.parse_error] " + what_arg;
return parse_error(w.c_str()); return parse_error(w.c_str());
} }
private: private:
parse_error(const char* what_arg) parse_error(const char* what_arg) : exception(what_arg) {}
: exception(what_arg)
{}
}; };
} // namespace detail2 } // namespace detail2