Warn users about potential conflicts with newer versions, i.e., base members should avoid generic names to avoid clashes with future member additions to basic_json.
(Run reuse.)
Also adds a new method as_base_class to make it easier to access members of a custom base class shadowed by nlohmann::basic_json
[x] The source code is amalgamated; that is, after making changes to the sources in the include/nlohmann directory, run make amalgamate to create the single-header files single_include/nlohmann/json.hpp and single_include/nlohmann/json_fwd.hpp. The whole process is described here.
coverage: 100.0%. remained the same when pulling 0f6d47133e5497fc42a9ef8a18291b1835a17eef on barcode:clean_up_custom_base_class into 5d2754306d67d1e654a1a34e1d2e74439a9d53b3 on nlohmann:develop.
(Second part of the points listed in https://github.com/nlohmann/json/pull/3110#issuecomment-1229141478, the rest is done in a different PR to prevent mixing of separate issues / features)
Also adds a new method
as_base_class
to make it easier to access members of a custom base class shadowed bynlohmann::basic_json
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filessingle_include/nlohmann/json.hpp
andsingle_include/nlohmann/json_fwd.hpp
. The whole process is described here.