1

How do I erase elements from a cpprest json array? Have I got to create a new copy of the array that only has the elements I want?

Version 2.5.0

Scott Langham
  • 58,735
  • 39
  • 131
  • 204

1 Answers1

1

You can use the functionality that the JSON array class has built in. There are two erase functions for the web::json::array class:

iterator web::json::array::erase(iterator position);
void web::json::array::erase(size_type index);

You can choose whichever one works best for you.

Casablanca Documentation on erase: http://microsoft.github.io/cpprestsdk/classweb_1_1json_1_1array.html#a4d08df9be2e24e1ca6f00d7c07448f0f

Kirkova
  • 319
  • 1
  • 9