-
// inherit class
namespace handler{
class json: public nlohmann::json {
// functions
};
}
//This one one works fine but below code gives error ( exception )
nlohmann::json parseConf(const tstring &s)
{
nlohmann::json configJSON = nlohmann::json::parse(s);
return configJSON;
}
// error
handler::json parseConf(const tstring &s)
{
return handler::json::parse(s);
} type must be array but is object |
Beta Was this translation helpful? Give feedback.
Answered by
nlohmann
Dec 4, 2020
Replies: 1 comment 5 replies
-
Can you please provide more information? Also note the |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
nlohmann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you please provide more information?
Also note the
nlohmann::json
is not really designed to be inherited from.