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
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
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