diff --git a/Road-toward-3.0.0.md b/Road-toward-3.0.0.md index f96717e..8eba87d 100644 --- a/Road-toward-3.0.0.md +++ b/Road-toward-3.0.0.md @@ -13,4 +13,38 @@ In case of bugs, there may be another 2.x.x release. However, pushing forward ve # Changes -This section shall list the changes that have been made past version 2.1.1. If possible, we shall provide examples how to change existing tools to work with the 3.0.0 release. \ No newline at end of file +This section shall list the changes that have been made past version 2.1.1. If possible, we shall provide examples how to change existing tools to work with the 3.0.0 release. + +## Removal of deprecated input stream constructor + +[Issue 480](https://github.com/nlohmann/json/issues/480) describes the removal of constructor `explicit basic_json(std::istream& i, const parser_callback_t cb = nullptr)`. + +### Code changes + +New code should use the `parse()` function. Let `ss` be a stream and `cb` be a parse callback function. + +Old code: + +```cpp +json j(ss, cb); +``` + +New code: + +```cpp +json j = json::parse(ss, cb); +``` + +If no callback function is used, also the following code works: + +```cpp +json j; +j << ss; +``` + +or + +```cpp +json j; +ss >> j; +``` \ No newline at end of file