11.3.1

来源:互联网 发布:caxa数控车编程软件 编辑:程序博客网 时间:2024/05/30 22:48

11.15

mapped_type : vector< int >key_type : intvalue_type : std::pair< int, vector<int> >

11.16

std::map<int, std::string> map;map[10010] = "132";std::map<int, std::string>::iterator it = map.begin();it->second = "131";

11.17

copy(v.begin(), v.end(), inserter(c, c.end())); // 合法copy(v.begin(), v.end(), back_inserter(c)); // 不合法,multiset没有push_back。copy(c.begin(), c.end(), inserter(v, v.end())); // 合法copy(c.begin(), c.end(), back_inserter(v)); // 合法

11.18

std::map<std::string, size_t>::const_iterator;

11.19

using compareType = bool (*)(const Sales_data &lhs, const Sales_data &rhs);std::multiset<Sales_data, compareType> bookstore(compareIsbn);std::multiset<Sales_data, compareType>::iterator c_it = bookstore.begin();
0 0