replace constructor by from/to_json: array_t

- tweaked a bit how `get<container<json>>` is handled
- added a from_json overload for forward list
This commit is contained in:
Théo DELRIEU 2017-01-08 16:17:47 +01:00
parent 6d427acdde
commit c847e0eea2
4 changed files with 249 additions and 171 deletions

View file

@ -1004,6 +1004,8 @@ TEST_CASE("value conversion")
CHECK_THROWS_AS((json().get<std::vector<json>>()), std::logic_error);
CHECK_THROWS_AS((json().get<std::list<json>>()), std::logic_error);
// does type really must be an array? or it rather must not be null?
// that's what I thought when other test like this one broke
CHECK_THROWS_WITH((json().get<std::list<int>>()), "type must be array, but is null");
CHECK_THROWS_WITH((json().get<std::vector<int>>()), "type must be array, but is null");
CHECK_THROWS_WITH((json().get<std::vector<json>>()), "type must be array, but is null");