More C++ Idioms
Table of Contents
Note: synonyms for each idiom are listed in parentheses.
- Adapter Template TODO
- Address Of
Readed,没啥用
- Algebraic Hierarchy
Readed,没啥用
- Attach by Initialization
Readed,没啥用
- Attorney-Clie nt
有点用
- Barton-Nackman trick
- Base-from-Member
- Boost muta nt
有点意思,实现了一个reverse
- Calling Virtuals During Initialization
有点意思,用template做的,但是和virtual函数没关系吧,并且必须要求static定义
- Capability Query
- Checked delete
- Clear-and-minimize
- Coercion by Member Template
- Computational Constructor
- Concrete Data Type
- Const auto_ptr
- Construct On First Use
- Construction Tracker
- Copy-and-swap
For operator=。 有用
- Copy-on-write
- Intrusive reference counting (Counted Body)
- Covariant Return Types TODO
- Curiously Recurring Template Pattern (CRTP)
- Non-intrusive reference counting (Detached Counted Body)
TODO
- Empty Base Optimization (EBO)
- enable-if
有用,but VS.net not support
- Envelope Letter
TODO
- Erase-Remove
有用
- Execute-Around Pointer
- Exploding Return Type TODO
- Export Guard Macro TODO
- Expression-template
有用,表达式模板,用来延迟求值,生成树
- Fake Vtable TODO
- Fast Pimpl
TODO
- Final Class
有用
- Free Function Allocators
- Function Object TODO
- Generic Container Idioms
有用,但不大
- Hierarchy Generation TODO
- Include Guard Macro
- Inline Guard Macro
- Inner Class
- Int-To-Type
- Interface Class
- Iterator Pair
- Making New Friends
- Metafunction
- Move Constructor
- Multi-statement Macro
- Member Detector
- Named Constructor
- Named External Argument TODO
- Named Loop (labeled loop)
- Named Parameter
有用,
- Named Template Parameters TODO
- Nifty Counter (Schwarz Counter)
- Non-copyable Mixin
- Non-member Non-friend Function
TODO
- Non-throwing swap
- Non-Virtual Interface (NVI, Public Overloaded Non-Virtuals Call Protected Non-Overloaded Virtuals)
- nullptr
- Object Generator
- Object Template TODO
- Parameterized Base Class (Parameterized Inheritance)
- Pimpl (Handle Body, Compilation Firewall, Cheshire Cat)
- Policy Clone (Metafunction wrapper)
- Policy-based Design TODO
- Polymorphic Exception
- Polymorphic Value Types
TODO
- Recursive Type Composition TODO
- Requiring or Prohibiting Heap-based Objects
- Resource Acquisition Is Initialization (RAII, Execute-Around Object, Scoped Locking)
- Resource Return
- Return Type Resolver
- Runtime Static Initialization Order Idioms
- Safe bool
- Scope Guard
- Substitution Failure Is Not An Error (SFINAE)
- Shortening Long Template Names TODO
- Shrink-to-fit
- Small Object Optimization TODO
- Smart Pointer
- Storage Class Tracker TODO
- Tag Dispatching
TODO
- Temporary Base Class
- Temporary Proxy
- The result_of technique TODO
- Thin Template
- Traits
TODO
- Type Erasure TODO
- Type Generator (Templated Typedef)
- Type Safe Enum
- Type Selection
- Virtual Constructor
- Virtual Friend Function
More C++ Idioms的更多相关文章
- Kotlin Reference (二) Idioms
most from reference 一些常用操作 创建单例类 object 数据类data classList.Map.Array的简单操作Lazy延迟加载属性空类型?空类型表达式?..?:.?. ...
- English idioms
a hot potato : speak of an issue(mostly current) which many people are talking about and which is us ...
- Java 进阶 hello world! - 中级程序员之路
Java 进阶 hello world! - 中级程序员之路 Java是一种跨平台的语言,号称:"一次编写,到处运行",在世界编程语言排行榜中稳居第二名(TIOBE index). ...
- 浅谈WebService的版本兼容性设计
在现在大型的项目或者软件开发中,一般都会有很多种终端, PC端比如Winform.WebForm,移动端,比如各种Native客户端(iOS, Android, WP),Html5等,我们要满足以上所 ...
- 我的公司培训讲义(1):.NET开发规范教程
这是1年多以前我在公司所做讲座的讲义,现在与园友们分享,欢迎拿去使用.一起讨论.文中有若干思考题,对园友们是小菜一碟.另有设计模式讲义一篇,随后发布.博文上了首页,感谢博客园团队推荐,也感谢所有园友的 ...
- [转载]Google Guava官方教程(中文版)
原文链接 译文链接 译者: 沈义扬,罗立树,何一昕,武祖 校对:方腾飞 引言 Guava工程包含了若干被Google的 Java项目广泛依赖 的核心库,例如:集合 [collections] ...
- JCIP chap3 share objects
"同步"确保了操作的原子性执行,但它还有其它重要的方面:memory visibility.我们不但要确保当一个线程在使用一个对象的时候,其它线程不能修改这个对象,而且还要保证该线 ...
- matplotlib 高级用法实例--共享x轴
http://localhost:8888/notebooks/duanqs/matplotlib_advanced_example.ipynb 我不会弄呀, 刚才从matplotlib文档里吧示例用 ...
- java程序性能优化
一.避免在循环条件中使用复杂表达式 在不做编译优化的情况下,在循环中,循环条件会被反复计算,如果不使用复杂表达式,而使循环条件值不变的话,程序将会运行的更快. 例子: import java.util ...
随机推荐
- HTML5中input[type='date']自定义样式
HTML5提供了日历控件功能,缩减了开发时间,但有时它的样式确实不如人意,我们可以根据下面的代码自行修改. 建议:复制下面的代码段,单独建立一个css文件,方便我们修改. /* 修改日历控件类型 */ ...
- Python如何操作redis
做UI自动化时,遇到一个问题,需要在后台操作完成后,产生结果才能在前端进行操作,但是用自动化在后台操作又很麻烦,就想直接操作数据库,然后再 在前端进行操作:这时遇到一个问题,在后台操作时,会写入到数据 ...
- 20165326 Linux系统安装及学习
Linux安装及学习 一.系统安装 此处选取安装的材料:LInux5.2.6 & ubuntu16.04.03 linux的安装:十分顺利,从官网选取了最新版本,根据图文步骤安装成功. ubu ...
- 关于 global nonlocal 用法
# 1 关于 globals() locals() nolocl 还有内置函数的引用## 概念的解释# 命名空间# 1 局部命名空间:每一个函数都有自己的命名空间# 2 全局命名空间:写在函数外的变量 ...
- python 常用的高阶函数
前言 高阶函数指的是能接收函数作为参数的函数或类:python中有一些内置的高阶函数,在某些场合使用可以提高代码的效率. map() map函数可以把一个迭代对象转换成另一个可迭代对象,不过在pyth ...
- [转]JavaScript与元素间的抛物线轨迹运动
在张鑫旭的博客看到这个抛物线的小动画,觉得很感兴趣,转载一下方便研究~ 原文地址:http://www.zhangxinxu.com/wordpress/?p=3855 在页面上添加元素的位移动画,除 ...
- HDU 6106 17多校6 Classes(容斥简单题)
Problem Description The school set up three elective courses, assuming that these courses are A, B, ...
- 【Python】Excel操作-2 (07版本以下Excel操作,其实不怎么用了,麻蛋,预习了2天课间才发现,还说怎么跟老师讲的不一样)
#保存修改Excel import xlrd from xlutils.copy import copy #打开Excel文档并将内容读取到内存 readbook=xlrd.open_workbook ...
- 小白学习Python遇到的一些2.7与3.X之间的不同问题
1.输入字母出错问题 原本跟着视频一起学习,currency_str_value=input(‘请输入带单位货币金额’) 但是运行的时候,输入数字就没有问题,只要带上了字母就会报错,后来百度,pyth ...
- react-native 自定义 下拉刷新 / 上拉加载更多 组件
1.封装 Scroller 组件 /** * 下拉刷新/上拉加载更多 组件(Scroller) */ import React, {Component} from 'react'; import { ...