赞
踩
任务:阅读C++11及其之后标准或STL源代码,选择其中的一个内容或一部分内容进行学习,形成研究报告。
说明:STL源码(Standard Template Library 标准库模板)实际上就是数据结构,比如:stack栈、list链表、queue队列、set集合等,所以分析 STL源码就是分析这些数据结构。
#创建一个会返回临时 map 对象的函数
std::map<std::string,int> disMap() {
std::map<std::string, int>tempMap{ {"C语言教程",10},{"STL教程",20} };
return tempMap;
}
//调用 map 类模板的移动构造函数创建 newMap 容器
std::map<std::string, int>newMap(disMap());
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。