notes: unordered_map:
程序员文章站
2022-05-12 23:32:27
...
https://blog.csdn.net/Cypress1010/article/details/53669409
#include<unordered_map>
std::unordered_map< std::string,std::vector<float> > bins_;
const auto& bins = json_config.at ("bin_list");
for(auto bin_it = bins.begin(); bin_it != bins.end(); ++bin_it)
{
const std::string& bin_id = bin_it.key();
const std::vector<float>& bin_param = bin_it.value();
bins_.insert(std::make_pair(bin_id,bin_param));
}
for(auto it : bins_)
{
std::cout<<"bin_id:"<<it.first<<std::endl;
auto i = it.second;
std::cout
<<"x:"
<<i[0]
<<" y:"
<<i[1]
<<" z:"
<<i[2]
<<std::endl;
}
result:
上一篇: 聪明的质监员 noiip 提高
下一篇: unordered_map
推荐阅读
-
CSS3 Notes: -webkit-box-reflect实现倒影的实例
-
C++ Notes-Inheritance-06
-
某大佬的Python读书笔记:70个注意的小Notes对于初学者十分友好
-
Data-Structure-Notes
-
Learning notes | Data Analysis: 1.1 data evaluation
-
C++ Notes-Inheritance-03
-
Python for Data Analysis v2 | Notes_ Chapter_8 数据规整:聚合、合并和重塑
-
Python for Data Analysis v2 | Notes_ Chapter_9 绘图和可视化
-
Python for Data Analysis v2 | Notes_ Chapter 3 Python 的数据结构、函数和文件
-
Python for Data Analysis v2 | Notes_ Chapter_10 数据聚合与分组运算