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)
- Empty Base Optimization (EBO)
- enable-if 有用,but VS.net not support
- Envelope Letter
- Erase-Remove 有用
- Execute-Around Pointer
- Exploding Return Type TODO
- Export Guard Macro TODO
- Expression-template 有用,表达式模板,用来延迟求值,生成树
- Fake Vtable TODO
- Fast Pimpl
- 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
- 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
- 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
- Temporary Base Class
- Temporary Proxy
- The result_of technique TODO
- Thin Template
- Traits
- Type Erasure TODO
- Type Generator (Templated Typedef)
- Type Safe Enum
- Type Selection
- Virtual Constructor
- Virtual Friend Function