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 ...
随机推荐
- React虚拟DOM浅析
在Web开发中,需要将数据的变化实时反映到UI上,这时就需要对DOM进行操作,但是复杂或频繁的DOM操作通常是性能瓶颈产生的原因,为此,React引入了虚拟DOM(Virtual DOM)的机制. 什 ...
- QuanbenSoft Windows Runtime (Windows Store)Apps 应用及其框架总览
Parrot Simple audio repeater for language learners http://www.windowsphone.com/en-au/store/app/parro ...
- mysql存不了中文的解决办法
driver=com.mysql.jdbc.Driverurl=jdbc:mysql://127.0.0.1:3306/testdb?useUnicode=true&characterEnco ...
- 【贪心】HDU 1257
HDU 1257 最少拦截系统 题意:中文题不解释. 思路:网上有说贪心有说DP,想法就是开一个数组存每个拦截系统当前最高能拦截的导弹高度.输入每个导弹高度的时候就开始处理,遍历每一个拦截系统,一旦最 ...
- 弹出popwindow 背景变暗
先看下效果图吧 代码如下 package com.example.administrator.popwindowdemo.view; import android.app.Activity; impo ...
- css单位:em,rem解释
em:所有浏览器都符合:1em=16px;1.具有继承性2.em的根元素是body,当设置了根元素的大小时,大小是定义的数字乘以根元素定义的大小值 rem:1rem=16pxrem不具有继承性,其根元 ...
- 初学后台框架总结篇二——快速了解CI框架
一.下载CI框架并安装,这里放置一张自己的项目目录结构图 目录框架搭建好之后开始将自己的项目与框架融合 二.更改相关配置 1.用任何文本编辑器打开 application/config/config. ...
- ZOJ1913 Euclid's Game (第一道简单的博弈题)
题目描述: Euclid's Game Time Limit: 2 Seconds Memory Limit: 65536 KB Two players, Stan and Ollie, p ...
- 【http代理报文】通过发包实现代理请求网页内容
工作中,我们难免需要通过TCP/IP协议发送报文来直接请求网页内容(比如爬虫工具),有同学问如何通过HTTP代理来请求网页,其实我们只需要把报文稍稍修改下,发送给代理服务器即可实现. 基础不过关的朋友 ...
- 微软StockTrader应用程序
这是一个采用 .NET Enterprise Application Server 技术的端到端示例应用程序.应用程序代码可以从 这里 下载. 代码中演示了WCF服务和移动开发,包括用Xamarin ...