Search code examples
jsonboostboost-propertytree

how to create empty array?


It's possible to get following output from boost::property_tree::json_parser::write_json

{
  "id": "id",
  "method": "test_method",
  "params": []
}

I know how to create array with some items, but when I try to create empty array, I've get "params": ""


Solution

  • I've asked about this issue in boost's mail-list. In general: it's not possible, because json is typed, but property-tree isn't. http://lists.boost.org/boost-users/2011/03/66911.php