mirror of
https://github.com/nlohmann/json.git
synced 2025-06-13 13:29:34 +08:00
👌 clean operator[]
This commit is contained in:
parent
e4af1ddb18
commit
d4a91b7445
@ -3669,13 +3669,7 @@ class basic_json
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if JSON_DIAGNOSTICS
|
|
||||||
reference result = m_value.array->operator[](idx);
|
|
||||||
result.m_parent = this;
|
|
||||||
return result;
|
|
||||||
#else
|
|
||||||
return m_value.array->operator[](idx);
|
return m_value.array->operator[](idx);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(type_error::create(305, diagnostics() + "cannot use operator[] with a numeric argument with " + std::string(type_name())));
|
JSON_THROW(type_error::create(305, diagnostics() + "cannot use operator[] with a numeric argument with " + std::string(type_name())));
|
||||||
|
@ -20305,13 +20305,7 @@ class basic_json
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if JSON_DIAGNOSTICS
|
|
||||||
reference result = m_value.array->operator[](idx);
|
|
||||||
result.m_parent = this;
|
|
||||||
return result;
|
|
||||||
#else
|
|
||||||
return m_value.array->operator[](idx);
|
return m_value.array->operator[](idx);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSON_THROW(type_error::create(305, diagnostics() + "cannot use operator[] with a numeric argument with " + std::string(type_name())));
|
JSON_THROW(type_error::create(305, diagnostics() + "cannot use operator[] with a numeric argument with " + std::string(type_name())));
|
||||||
|
Loading…
Reference in New Issue
Block a user