Json: about from_json and to_json function

Created on 28 Aug 2017  路  2Comments  路  Source: nlohmann/json

Hi,
Do I need to design functions for each custom type?
Thx

question proposed fix

All 2 comments

Yes

If a lot of your types share a custom property/interface, you could partially specialize adl_serializer, and use enable_if to only write the code once.

But for regular application types, it is needed to define one from_json/to_json pair for each one.

Was this page helpful?
0 / 5 - 0 ratings