cleanup, docs
This commit is contained in:
@@ -5,6 +5,7 @@ DValue DValue::values() const
|
||||
return value : a list-shaped DValue containing each iterated child value
|
||||
|
||||
:see
|
||||
>types
|
||||
0_DValue
|
||||
2_DValue_each
|
||||
2_DValue_push
|
||||
@@ -12,8 +13,9 @@ return value : a list-shaped DValue containing each iterated child value
|
||||
:content
|
||||
Copies the values produced by `each()` into a new list-shaped `DValue`.
|
||||
|
||||
```cpp
|
||||
DValue titles = articles.map([](const DValue& row, String) {
|
||||
DValue v; v = row.get_by_path("title").to_string(); return(v);
|
||||
}).values();
|
||||
```
|
||||
:example
|
||||
DValue user;
|
||||
user["name"] = "Ada";
|
||||
user["role"] = "admin";
|
||||
DValue values = user.values();
|
||||
print(values.is_list() ? "list\n" : "map\n");
|
||||
|
||||
Reference in New Issue
Block a user