Starting with version 3.0, json::json(std::ifstream&) deprecated. Instead, use json::parse() :
std::ifstream ifs("{\"json\": true}"); json j = json::parse(ifs);
JSON Update for Modern C ++ Version 2
Starting with version 2.0, json::operator>>() id deprecated . Instead, use json::json() :
std::ifstream ifs("{\"json\": true}"); json j(ifs);
Original answer for JSON for Modern C ++ version 1
Use json::operator>>(std::istream&) :
json j; std::ifstream ifs("{\"json\": true}"); ifs >> j;
source share