deploy: 098eebd412
This commit is contained in:
1 parent
70feeb496c
commit
8279f43a4b
471 files changed
+1737
-1335
No files matched your search
@@ -24,7 +24,7 @@ for (const auto [key, value] : v.items())
|
||||
}
|
||||
```
|
||||
|
||||
Note the `const auto` (by value), not `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 (`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 `const auto&` (as in the first snippet) also works, as it binds to that temporary, but a non-const `auto&` does not compile.
|
||||
|
||||
## Return value
|
||||
|
||||
|
||||
Reference in new issue
Block a user