1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-10 22:00:59 +03:00

more test cases

This commit is contained in:
Niels
2015-01-31 21:25:38 +01:00
parent 385865c4ec
commit 5ec433604a
2 changed files with 47 additions and 10 deletions

View File

@ -350,7 +350,7 @@ class basic_json
// if object is wanted but impossible, throw an exception
if (manual_type == value_t::object and not is_object)
{
throw std::logic_error("cannot create JSON object");
throw std::logic_error("cannot create JSON object from initializer list");
}
}
@ -379,15 +379,7 @@ class basic_json
inline static basic_json object(list_init_t l = list_init_t())
{
// if more than one element is in the initializer list, wrap it
if (l.size() > 1)
{
return basic_json({l}, false, value_t::object);
}
else
{
return basic_json(l, false, value_t::object);
}
return basic_json(l, false, value_t::object);
}
///////////////////////////////////////