We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To avoid including json.hpp in header files, I would like to forward declare nlohmann::json as follows:
json.hpp
nlohmann::json
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:
basic_json<>
struct json : basic_json<> { using basic_json<>::basic_json; };
What do you think?
The text was updated successfully, but these errors were encountered:
See discussions in #314
Sorry, something went wrong.
@marton78 Please add this idea to #314.
@nlohmann @marton78 That idea was already mentioned in #314.
No branches or pull requests
To avoid including
json.hpp
in header files, I would like to forward declarenlohmann::json
as follows:However, this doesn't work, since
nlohmann::json
is a typedef. If you just derived it frombasic_json<>
, it would work:What do you think?
The text was updated successfully, but these errors were encountered: