deploy: 098eebd412
This commit is contained in:
1 parent
70feeb496c
commit
8279f43a4b
471 files changed
+1737
-1335
No files matched your search
@@ -27,9 +27,10 @@ for (const auto [key, value] : v.items())
|
||||
}
|
||||
```
|
||||
|
||||
Note the `#!cpp const auto` (by value), not `#!cpp const auto&`: unlike `BasicJsonType::items()`, whose elements are
|
||||
references into an existing object, a view's `item` is produced on the fly for each step of the iteration, so there
|
||||
is nothing for a reference to bind to.
|
||||
Taking `item` by value (`#!cpp const auto`) is recommended: unlike `BasicJsonType::items()`, whose elements are
|
||||
references into an existing object, a view's `item` is produced on the fly for each step of the iteration and is
|
||||
cheap to copy. A `#!cpp const auto&` (as in the first snippet) also works, as it binds to that temporary, but a
|
||||
non-const `#!cpp auto&` does not compile.
|
||||
|
||||
## Return value
|
||||
|
||||
|
||||
Reference in new issue
Block a user