/
githubmirror
/
json
Обзор
Документация
Войти
/
githubmirror
/
json
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.6.0
doc/examples/insert.cpp
17 строк
352 B
Niels Lohmann
:bookmark: set version to 3.1.0
02 фев 2018, 00:20
Не верифицирован
02 фев 2018, 00:20
0258484
Код
Авторство
О чём код?
#include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON array json v = {1, 2, 3, 4}; // insert number 10 before number 3 auto new_pos = v.insert(v.begin() + 2, 10); // output new array and result of insert call std::cout << *new_pos << '\n'; std::cout << v << '\n'; }