try minimal example

parent edc203a8
...@@ -83,13 +83,6 @@ class exception : public std::exception ...@@ -83,13 +83,6 @@ class exception : public std::exception
class parse_error : public exception class parse_error : public exception
{ {
public: public:
static parse_error create(const std::string& what_arg)
{
std::string w = "[json.exception.parse_error] " + what_arg;
return parse_error(w.c_str());
}
private:
parse_error(const char* what_arg) : exception(what_arg) {} parse_error(const char* what_arg) : exception(what_arg) {}
}; };
...@@ -111,7 +104,8 @@ TEST_CASE("Tests with disabled exceptions") ...@@ -111,7 +104,8 @@ TEST_CASE("Tests with disabled exceptions")
SECTION("test") SECTION("test")
{ {
auto error = nlohmann::detail2::parse_error::create("foo"); std::string w = "[json.exception.parse_error] foo";
auto error = nlohmann::detail2::parse_error(w.c_str());
CHECK(std::string(error.what()) == "[json.exception.parse_error] foo"); CHECK(std::string(error.what()) == "[json.exception.parse_error] foo");
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment