Description
json_fwd.hpp no longer works. When using it in a header there is an "incomplete class" error in the corresponding code file.
I have already figured out why this happens: The basic_json template differs between json_fwd.hpp and json.hpp. In json_fwd.hpp there is a class CustomBaseClass = void at the end which is not there in json.hpp (line 151 in json_fwd.hpp). When I manually remove that line in my project it works fine.
Reproduction steps
Just #include <nlohmann/json_fwd.hpp> in a header and try to use it in the code file.
Expected vs. actual results
Expected: Should work to use json_fwd.hpp to forward-declare nlohmann::json.
Actual: Does not work to forward-declare using json_fwd.hpp; results in "incomplete class" error in code file when trying to use it.
Minimal code example
No response
Error messages
error C2976: 'nlohmann::json_abi_v3_11_2::basic_json': too few template arguments
error C3203: 'basic_json': unspecialized class template can't be used as a template argument for template parameter 'T', expected a real type
Compiler and operating system
Windows, Microsoft Visual C++ 2019
Library version
3.11.2
Validation
Description
json_fwd.hppno longer works. When using it in a header there is an "incomplete class" error in the corresponding code file.I have already figured out why this happens: The
basic_jsontemplate differs betweenjson_fwd.hppandjson.hpp. Injson_fwd.hppthere is aclass CustomBaseClass = voidat the end which is not there injson.hpp(line 151 injson_fwd.hpp). When I manually remove that line in my project it works fine.Reproduction steps
Just
#include <nlohmann/json_fwd.hpp>in a header and try to use it in the code file.Expected vs. actual results
Expected: Should work to use
json_fwd.hppto forward-declarenlohmann::json.Actual: Does not work to forward-declare using
json_fwd.hpp; results in "incomplete class" error in code file when trying to use it.Minimal code example
No response
Error messages
Compiler and operating system
Windows, Microsoft Visual C++ 2019
Library version
3.11.2
Validation
developbranch is used.