更新时间:2023-01-15 23:10:36
自版本3.0 起,不推荐使用json::json(std::ifstream&)
.人们应该使用
Since version 3.0, json::json(std::ifstream&)
is deprecated. One should use json::parse()
instead:
std::ifstream ifs("{\"json\": true}");
json j = json::parse(ifs);
Since version 2.0, json::operator>>() id deprecated
. One should use json::json()
instead:
std::ifstream ifs("{\"json\": true}");
json j(ifs);
使用json::operator>>(std::istream&)
:
Use json::operator>>(std::istream&)
:
json j;
std::ifstream ifs("{\"json\": true}");
ifs >> j;