Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/examples/at__object_t_key_type_const.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using json = nlohmann::json;
int main()
{
// create JSON object
json object =
const json object =
{
{"the good", "il buono"},
{"the bad", "il cattivo"},
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/begin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main()
// create an array value
json array = {1, 2, 3, 4, 5};

// get am iterator to the first element
// get an iterator to the first element
json::iterator it = array.begin();

// serialize the element that the iterator points to
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/cbegin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main()
// create an array value
const json array = {1, 2, 3, 4, 5};

// get am iterator to the first element
// get an iterator to the first element
json::const_iterator it = array.cbegin();

// serialize the element that the iterator points to
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/cend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main()
// create an array value
json array = {1, 2, 3, 4, 5};

// get am iterator to one past the last element
// get an iterator to one past the last element
json::const_iterator it = array.cend();

// decrement the iterator to point to the last element
Expand Down
1 change: 0 additions & 1 deletion doc/examples/contains_json_pointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ int main()
std::cout << std::boolalpha
<< j.contains("/number"_json_pointer) << '\n'
<< j.contains("/string"_json_pointer) << '\n'
<< j.contains("/string"_json_pointer) << '\n'
<< j.contains("/array"_json_pointer) << '\n'
<< j.contains("/array/1"_json_pointer) << '\n'
<< j.contains("/array/-"_json_pointer) << '\n'
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main()
// create a JSON object
json j_object = {{"one", 1}, {"two", 2}};

// call find
// call count()
auto count_two = j_object.count("two");
auto count_three = j_object.count("three");

Expand Down
2 changes: 1 addition & 1 deletion doc/examples/end.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main()
// create an array value
json array = {1, 2, 3, 4, 5};

// get am iterator to one past the last element
// get an iterator to one past the last element
json::iterator it = array.end();

// decrement the iterator to point to the last element
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/erase__IteratorType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int main()
json j_array = {1, 2, 4, 8, 16};
json j_string = "Hello, world";

// call erase
// call erase()
j_boolean.erase(j_boolean.begin());
j_number_integer.erase(j_number_integer.begin());
j_number_float.erase(j_number_float.begin());
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/erase__IteratorType_IteratorType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int main()
json j_array = {1, 2, 4, 8, 16};
json j_string = "Hello, world";

// call erase
// call erase()
j_boolean.erase(j_boolean.begin(), j_boolean.end());
j_number_integer.erase(j_number_integer.begin(), j_number_integer.end());
j_number_float.erase(j_number_float.begin(), j_number_float.end());
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/erase__key_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main()
// create a JSON object
json j_object = {{"one", 1}, {"two", 2}};

// call erase
// call erase()
auto count_one = j_object.erase("one");
auto count_three = j_object.erase("three");

Expand Down
2 changes: 1 addition & 1 deletion doc/examples/erase__size_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main()
// create a JSON array
json j_array = {0, 1, 2, 3, 4, 5};

// call erase
// call erase()
j_array.erase(2);

// print values
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/operatorarray__size_type_const.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using json = nlohmann::json;
int main()
{
// create JSON array
json array = {"first", "2nd", "third", "fourth"};
const json array = {"first", "2nd", "third", "fourth"};

// output element at index 2 (third element)
std::cout << array.at(2) << '\n';
Expand Down