template <typename... Args>
json& emplace_back(Args&&... args);
args
Arguments to forward to the constructor of the json value
A reference to the emplaced json value.
Throws std::domain_error
if not a json array.
json arr(json_array_arg);
arr.emplace_back(10);
arr.emplace_back(20);
arr.emplace_back(30);
std::cout << arr << '\n';
Output:
[10,20,30]