auto&prefetch
来源:互联网 发布:算法精解 pdf 百度云 编辑:程序博客网 时间:2024/06/05 04:28
auto项目开始对auto解禁了之后,才开始使用,起码对于vector<xxx>::iterator这样的代码起了很大的简洁的作用。
后来发现在写多个版本的代码的时候也让一切变得很简洁,比如原来是:
#if BONESETBoneSet* bone = GetBoneRoot();#elseBoneNode* bone = GetBoneRoot();#endif
使用auto的时候就可以是
auto bone = GetBoneRoot();
但是其中也容易犯错误,尤其是程序员自大的以为可以不看文档就直接使用(比如当时的我),如果返回的是const type&的话使用auto的时候,需要也带上引用符号和const这样的修饰符,auto演绎出来的只是类型。
msdn上面的文档:
The auto keyword deduces the type of a declared variable from its initialization expression.
To use the auto keyword, declare a variable with the auto keyword instead of a type, and specify an initialization expression. In addition, you can modify the auto keyword with specifiers and declarators such as const, volatile, pointer (*), reference (&), and rvalue reference (&&). The compiler evaluates the initialization expression and then uses that information to deduce the type of the variable.
prefetch
就是提前把一部分内存加载到cache里面,防止在用的时候产生cache miss,消耗大量的性能,以前在console上开发的时候常常使用这个,对优化很有好处,在pc上面以为是没有的,但是后来发现sse库里面有这个支持,非常棒:
http://msdn.microsoft.com/en-us/library/cyxt4d09(v=vs.71).aspx
- auto&prefetch
- prefetch
- prefetch
- PREFETCH文件夹
- prefetch abort
- 认识prefetch
- dns-prefetch
- DNS Prefetch
- HTML5 prefetch
- Consumer Prefetch
- Prefetch Limit
- "auto"
- auto
- auto
- auto
- auto
- auto,
- auto
- Spring源码下载地址
- 远程桌面 不能粘贴文本 的解决办法
- 关于PreparedStatement插入Date类型值的方法
- coro::socket+coro::handle client编程(测试client)
- 修改Android解锁界面
- auto&prefetch
- BIT1007 Number Converter
- Mac下配置Android NDK环境并搭建Cocos2d-x环境并Eclipse正常编译运行Cocos2dX自带TestsDemo项目!
- test
- vi中怎么取消 查找 后的着色标记
- Binder通信流程图
- NYOJ-92:图像有用区域
- Hibernate 之 二级缓存
- 【VC报错】fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h