🔥 removed deprecated constructor #480
The constructor basic_json(std::istream&, const parser_callback_t) has been deprecated since version 2.0.0. This commit removes it together with its code example, deprecation macro, and test cases. The code now also compiles with -W-deprecated-declarations.
This commit is contained in:
parent
6b3912d936
commit
7b8fd864e2
7 changed files with 0 additions and 218 deletions
|
@ -1281,40 +1281,4 @@ TEST_CASE("constructors")
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("create a JSON value from an input stream")
|
||||
{
|
||||
SECTION("std::stringstream")
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "[\"foo\",1,2,3,false,{\"one\":1}]";
|
||||
json j(ss);
|
||||
CHECK(j == json({"foo", 1, 2, 3, false, {{"one", 1}}}));
|
||||
}
|
||||
|
||||
SECTION("with callback function")
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "[\"foo\",1,2,3,false,{\"one\":1}]";
|
||||
json j(ss, [](int, json::parse_event_t, const json & val)
|
||||
{
|
||||
// filter all number(2) elements
|
||||
if (val == json(2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
});
|
||||
CHECK(j == json({"foo", 1, 3, false, {{"one", 1}}}));
|
||||
}
|
||||
|
||||
SECTION("std::ifstream")
|
||||
{
|
||||
std::ifstream f("test/data/json_tests/pass1.json");
|
||||
json j(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue