To avoid including `json.hpp` in header files, I would like to forward declare `nlohmann::json` as follows: ```c++ namespace nlohmann { struct json; } struct my_stuff { int some_member; nlohmann::json encode() const; void decode(nlohmann::json const&); }; ``` However, this doesn't work, since `nlohmann::json` is a typedef. If you just derived it from `basic_json<>`, it would work: ```c++ struct json : basic_json<> { using basic_json<>::basic_json; }; ``` What do you think?
Activity
gregmarr commentedon Dec 6, 2016
See discussions in #314
nlohmann commentedon Dec 6, 2016
@marton78 Please add this idea to #314.
gregmarr commentedon Dec 6, 2016
@nlohmann @marton78 That idea was already mentioned in #314.