Effective Modern C++ 42 Specific Ways to Improve Your Use of C++11 and C++14
- Item 1: Understand template type deduction.
- Item 2: Understand auto type deduction.
- Item 3: Understand decltype.
- Item 4: Know how to view deduced types.
- Item 5: Prefer auto to explicit type declarations.
- Item 6: Use the explicitly typed initializer idiom when auto deduces undesired types.
- Item 7: Distinguish between () and {} when creating objects.
- Item 8: Prefer nullptr to 0 and NULL.
- Item 9: Prefer alias declarations to typedefs.
- Item 10: Prefer scoped enums to unscoped enums.
- Item 11: Prefer deleted functions to private undefined ones.
- Item 12: Declare overriding functions override.
- Item 13: Prefer const_iterators to iterators.
- Item 14: Declare functions noexcept if they won’t emit exceptions.
- Item 15: Use constexpr whenever possible.
- Item 16: Make const member functions thread safe.
- Item 17: Understand special member function generation.
- Item 18: Use std::unique_ptr for exclusive-ownership resource management.
- Item 19: Use std::shared_ptr for shared-ownership resource management.
- Item 20: Use std::weak_ptr for std::shared_ptr like pointers that can dangle.
- Item 21: Prefer std::make_unique and std::make_shared to direct use of new.
- Item 22: When using the Pimpl Idiom, define special member functions in the implementation file.
- Item 23: Understand std::move and std::forward.
- Item 24: Distinguish universal references from rvalue references.
- Item 25: Use std::move on rvalue references, std::forward on universal references.
- Item 26: Avoid overloading on universal references.
- Item 27: Familiarize yourself with alternatives to overloading on universal references.
- Item 28: Understand reference collapsing.
- Item 29: Assume that move operations are not present, not cheap, and not used.
- Item 30: Familiarize yourself with perfect forwarding failure cases.
- Item 31: Avoid default capture modes.
- Item 32: Use init capture to move objects into closures.
- Item 33: Use decltype on auto&& parameters to std::forward them.
- Item 34: Prefer lambdas to std::bind.
- Item 35: Prefer task-based programming to thread-based.
- Item 36: Specify std::launch::async if asynchronicity is essential.
- Item 37: Make std::threads unjoinable on all paths.
- Item 38: Be aware of varying thread handle destructor behavior.
- Item 39: Consider void futures for one-shot event communication.
- Item 40: Use std::atomic for concurrency, volatile for special memory.
- Item 41: Consider pass by value for copyable parameters that are cheap to move and always copied.
- Item 42: Consider emplacement instead of insertion.
Effective Modern C++ 42 Specific Ways to Improve Your Use of C++11 and C++14的更多相关文章
- 决定干点事儿--翻译一下《effective modern c++》
写了非常多关于C++11的博客.总是认为不踏实,非常多东西都是东拼西凑.市场上也非常少有C++11的优秀书籍,但幸运的是Meyers老爷子并没有闲赋.为我们带来了<effective moder ...
- [C++11] Effective Modern C++ 读书笔记
本文记录了我读Effective Modern C++时自己的一些理解和心得. item1:模板类型推导 1)reference属性不能通过传值参数传入模板函数.这就意味着如果模板函数需要一个refe ...
- Effective Modern C++翻译(1):序言
/*********************************************************** 关于书: 书是我从网上找到的effective Modern C++的样章,内 ...
- 《Effective Modern C++》翻译--简单介绍
北京时间2016年1月9日10:31:06.正式開始翻译.水平有限,各位看官若有觉得不妥之处,请批评指正. 之前已经有人翻译了前几个条目,有些借鉴出处:http://www.cnblogs.com/m ...
- Effective Modern C++:01类型推导
C++的官方钦定版本,都是以ISO标准被接受的年份命名,分别是C++98,C++03,C++11,C++14,C++17,C++20等.C++11及其后续版本统称为Modern C++. C++11之 ...
- Effective Modern C++翻译(2)-条款1:明白模板类型推导
第一章 类型推导 C++98有一套单一的类型推导的规则:用来推导函数模板,C++11轻微的修改了这些规则并且增加了两个,一个用于auto,一个用于decltype,接着C++14扩展了auto和dec ...
- 8 ways to improve ASP.NET Web API performance
ASP.NET Web API is a great piece of technology. Writing Web API is so easy that many developers don’ ...
- 《Effective Modern C++》翻译--条款4:了解怎样查看推导出的类型
条款4:了解怎样查看推导出的类型 那些想要了解编译器怎样推导出的类型的人通常分为两个阵营. 第一种阵营是实用主义者.他们的动力通常来自于编敲代码过程中(比如他们还在调试解决中),他们利用编译器进行寻找 ...
- Ten ways to improve the performance of large tables in MySQL--转载
原文地址:http://www.tocker.ca/2013/10/24/improving-the-performance-of-large-tables-in-mysql.html Today I ...
随机推荐
- ACM ICPC Vietnam National Second Round
A. Stock Market 枚举哪一天买入,哪一天卖出即可. #include<cstdio> #include<algorithm> using namespace st ...
- HDU 2222 AC自动机模板题
1.HDU 2222 2.题意:给出n个单词,一个字串,求有多少个单词在字串里出现了.注意给出的单词可能会重复,重复的不计. 3.总结:入门题.在查询这里还是不太懂. #include<bits ...
- java分享第十七天-01(封装操作xml类)
做自动化测试的人,都应该对XPATH很熟悉了,但是在用JAVA解析XML时,我们通常是一层层的遍历进去,这样的代码的局限性很大,也不方便,于是我们结合一下XPATH,来解决这个问题.所需要的JAR包: ...
- 将 java 项目打包成可运行的 jar 包(main 函数带参数),并上传到 linux 服务器上运行
一.概述 java项目有两种架构,一种是 B/S 架构的,一种是 C/S 架构的. 对于 B/S 架构来说,我们常见的 java ee 即是 B/S 架构,通常,开发人员会在本地进行开发,然后将项目打 ...
- Red Hat5下源码安装mysql5.6过程记录
1.安装cmake包 [root@edu soft]# tar -xzf cmake-.tar.Z [root@edu soft]# cd cmake- [root@edu cmake-]# ./co ...
- jquery修改Switchery复选框的状态
script //选择框 var mySwitch; /* * 初始化Switchery * * classNmae class名 */ function initSwitchery(classNam ...
- sql rowversion
RowsVersion就是timestamp 丢失更新的解决方法 丢失更新概念:当用户同时修改一行数据,他们先读取数据,放在前端进行修改,当修改后,再提交数据,这样最后提交的数据会覆盖先 ...
- .net core中使用openssl的公钥私钥进行加解密
这篇博文分享的是 C#中使用OpenSSL的公钥加密/私钥解密 一文中的解决方法在 .net core 中的改进.之前的博文针对的是 .NET Framework ,加解密用的是 RSACryptoS ...
- Android知识杂记(四)
1.完整退出activity的设计思路 1.1 封装一个基础activity类 public abstract class RootActivity extends FragmentActivity{ ...
- 用python实现的百度音乐下载器-python-pyqt-改进版
之前写过一个用python实现的百度新歌榜.热歌榜下载器的博文,实现了百度新歌.热门歌曲的爬取与下载.但那个采用的是单线程,网络状况一般的情况下,扫描前100首歌的时间大概得到40来秒.而且用Pyqt ...