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:
parent
6d427acdde
commit
c847e0eea2
4 changed files with 249 additions and 171 deletions
|
|
@ -391,19 +391,19 @@ TEST_CASE("adl_serializer specialization", "[udt]")
|
|||
|
||||
namespace nlohmann
|
||||
{
|
||||
// this might work in the future, not in the scope of this PR though
|
||||
// we have to make this very clear in the doc
|
||||
template <typename T>
|
||||
struct adl_serializer<std::vector<T>>
|
||||
{
|
||||
static void to_json(json& j, std::vector<T> const& opt)
|
||||
{
|
||||
}
|
||||
|
||||
static void from_json(json const& j, std::vector<T>& opt)
|
||||
{
|
||||
}
|
||||
};
|
||||
// TODO provide a real example, since this works now :)
|
||||
// template <typename T>
|
||||
// struct adl_serializer<std::vector<T>>
|
||||
// {
|
||||
// static void to_json(json& j, std::vector<T> const& opt)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// static void from_json(json const& j, std::vector<T>& opt)
|
||||
// {
|
||||
// }
|
||||
// };
|
||||
}
|
||||
|
||||
TEST_CASE("current supported types are preferred over specializations", "[udt]")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue