没有合适的资源?快使用搜索试试~ 我知道了~
C++11新特性小总结,常用的C++11新特性都有描述和伪代码描述。
资源推荐
资源详情
资源评论
1- auto 可以用于函数定义 , 但不能用于函数声明。
2- nullptr 取代 NULL :看实例代码 nullptr.cpp
3- foreach循环:
for(auto num : arr)
{
cout << num << endl;
}
4- 在STL容器方面新增了一些东西,
(1)array模板数组
std::array<int , 4> arrayDemo = { 1,2,3,4 };
for( auto itor : arrayDemo )
{
std::cout << itor << std::endl;
}
(2)forwar_list与list的区别就是它是单向链表 ,所以使用list和forward_list比使用array、vector和deque效率要高。
(3)std::unordered_map , std::map使用的数据结构为二叉树 , 而std::unordered_map内部是哈希表的实现方式。
如:
std::unordered_map<std::string, std::string> mymap =
{
{ "house","maison" },
{ "apple","pomme" }
};
(4)std::unordered_set , 在插入的时候不会自动排序, 使用unorder_set.insert(num);
2- nullptr 取代 NULL :看实例代码 nullptr.cpp
3- foreach循环:
for(auto num : arr)
{
cout << num << endl;
}
4- 在STL容器方面新增了一些东西,
(1)array模板数组
std::array<int , 4> arrayDemo = { 1,2,3,4 };
for( auto itor : arrayDemo )
{
std::cout << itor << std::endl;
}
(2)forwar_list与list的区别就是它是单向链表 ,所以使用list和forward_list比使用array、vector和deque效率要高。
(3)std::unordered_map , std::map使用的数据结构为二叉树 , 而std::unordered_map内部是哈希表的实现方式。
如:
std::unordered_map<std::string, std::string> mymap =
{
{ "house","maison" },
{ "apple","pomme" }
};
(4)std::unordered_set , 在插入的时候不会自动排序, 使用unorder_set.insert(num);
资源评论
陈雲飞
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功