mirror of
https://github.com/nlohmann/json.git
synced 2026-02-23 11:56:24 +00:00
- minor tweaks
This commit is contained in:
@@ -413,7 +413,7 @@ JSON& JSON::operator[](int index) {
|
||||
|
||||
array_t* array = static_cast<array_t*>(_payload);
|
||||
|
||||
if (index >= array->size()) {
|
||||
if (index >= (int)array->size()) {
|
||||
throw std::runtime_error("cannot access element at index " + to_string(index));
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ const JSON& JSON::operator[](const int index) const {
|
||||
|
||||
array_t* array = static_cast<array_t*>(_payload);
|
||||
|
||||
if (index >= array->size()) {
|
||||
if (index >= (int)array->size()) {
|
||||
throw std::runtime_error("cannot access element at index " + to_string(index));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user