1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

📝 add warning for items() on temporary objects #2040

This commit is contained in:
Niels Lohmann
2020-05-14 19:06:48 +02:00
parent 0857140839
commit bcf4f3ce9a
2 changed files with 10 additions and 0 deletions

View File

@ -20437,6 +20437,11 @@ class basic_json
element as string (see example). For primitive types (e.g., numbers),
`key()` returns an empty string.
@warning Using `items()` on temporary objects is dangerous. Make sure the
object's lifetime exeeds the iteration. See
<https://github.com/nlohmann/json/issues/2040> for more
information.
@return iteration proxy object wrapping @a ref with an interface to use in
range-based for loops