📝 add warning for items() on temporary objects #2040
This commit is contained in:
parent
0857140839
commit
bcf4f3ce9a
2 changed files with 10 additions and 0 deletions
|
@ -4946,6 +4946,11 @@ class basic_json
|
||||||
element as string (see example). For primitive types (e.g., numbers),
|
element as string (see example). For primitive types (e.g., numbers),
|
||||||
`key()` returns an empty string.
|
`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
|
@return iteration proxy object wrapping @a ref with an interface to use in
|
||||||
range-based for loops
|
range-based for loops
|
||||||
|
|
||||||
|
|
|
@ -20437,6 +20437,11 @@ class basic_json
|
||||||
element as string (see example). For primitive types (e.g., numbers),
|
element as string (see example). For primitive types (e.g., numbers),
|
||||||
`key()` returns an empty string.
|
`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
|
@return iteration proxy object wrapping @a ref with an interface to use in
|
||||||
range-based for loops
|
range-based for loops
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue