1
shuax 2021-01-21 17:48:28 +08:00 1
|
2
soaph 2021-01-21 18:01:22 +08:00 1
```cpp
for (auto& [key, value] : jv) { fmt::print("key: {}, value: {}\n", key, value); } ``` |
5
sl0000 OP @soaph 同理也找到 c++11 的实现,官方文档一句都没说这个。
for (auto & kvp : obj) { std::cout << "key: " << kvp.key() << ", value: " << kvp.value() << std::endl; } |