nlohmann / json

JSON for Modern C++
https://json.nlohmann.me
MIT License
42.18k stars 6.65k forks source link

Add helper types to make it easier to create a basic_json type with modified template parameters #3898

Open barcode opened 1 year ago

barcode commented 1 year ago

(First 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)

Make specifying a base class easier/less verbose.

This PR adds member templates to nlohmann::json which can be used to create a basic_json type with one replaced template parameter (e.g. nlohmann::json::with_changed_json_serializer_t<T>).

Tests and examples were modified to use those templates (except for regression tests).

Open questions from my side:

In case this will be added, i will write the documentation.


Pull request checklist

Read the Contribution Guidelines for detailed information.

coveralls commented 1 year ago

Coverage Status

coverage: 100.0%. remained the same when pulling 0d9f46f66dd952a5d3d7f7bff97ac03003fddc37 on barcode:make_specifying_adapted_json_type_easier into 5d2754306d67d1e654a1a34e1d2e74439a9d53b3 on nlohmann:develop.

barcode commented 1 year ago

Work on this PR is done and it only needs a review.