I have a class where I want to have a function that uses nlohmann::json& as the argument:
class MyClass
{
public:
void foo(nlohmann::json& node);
};
But I don't want to include the json.hpp file in my header, just my .cpp. How can I declare the nlohmann::json in the header? I tried:
namespace nlohmann
{
class json;
}
But that doesn't seem to work.