C++11新性能测试
2014-08-09 19:33
106 查看
// shared_ptr::operator* #include <iostream> #include <vector> #include <algorithm> using namespace std; int main () { int a[] = {1,2,3,4,5}; int b[] = {2,3,4,5,6}; int c[] = {3,4,5,6,7}; vector<vector<int>> vv; vv.reserve(10); vector<int> v1(a,a+5); vector<int> v2(b,b+5); vector<int> v3(c,c+5); vv.push_back(v1); vv.push_back(v2); vv.push_back(v3); auto p1 = vv.begin(); auto p2 = vv.end(); //自动类型推导 while(p1 != p2) { auto &vec = *p1; for_each(vec.begin(), vec.end(), [](int val){cout << val << " ";}); // lambda cout << endl; ++p1; } decltype(v1) &v4 = v1; for(int val: a) cout << "val = " << val <<" "; cout << endl; for(int val:v4) cout << "val = " << val <<" "; cout << endl; string str = "Hello,world"; for(auto c:str) cout << "c= " << c << " "; cout <<endl; return 0; }
相关文章推荐
- c++11新性能测试2
- c++11新性能测试3
- 性能特性测试系列2——c++11 std::function和正常调用函数效率比较
- c++11新性能测试4
- 性能测试用例模版
- Web性能测试工具
- Android 性能测试
- 接口性能测试(Jmeter)操作总结
- 关于js中几种遍历方法性能的测试
- ESFramework 4.0 性能测试
- Red5 性能测试
- Hive查询性能测试记录
- Redis 学习笔记(三):主从复制、主从配置和性能测试
- UT-Exynos4412 三星ARM四核旗舰开发平台android4.0体验-15游戏性能测试
- 手机知识与手机性能测试
- 性能测试之业务测试模型浅析
- 性能测试和压力测试的区别
- Ajax性能测试工具-Firefox插件系列
- 性能测试工具比较:LoadRunner vs JMeter - 测试结果数据比较
- 性能测试指标