More C++ Idioms

Table of Contents

Note: synonyms for each idiom are listed in parentheses.

  1. Adapter Template TODO
  2. Address Of                              Readed,没啥用
  3. Algebraic Hierarchy    Readed,没啥用
  4. Attach by Initialization Readed,没啥用
  5. Attorney-Clie  nt 有点用
  6. Barton-Nackman trick
  7. Base-from-Member
  8. Boost muta  nt 有点意思,实现了一个reverse
  9. Calling Virtuals During Initialization 有点意思,用template做的,但是和virtual函数没关系吧,并且必须要求static定义
  10. Capability Query
  11. Checked delete
  12. Clear-and-minimize
  13. Coercion by Member Template
  14. Computational Constructor
  15. Concrete Data Type
  16. Const auto_ptr
  17. Construct On First Use
  18. Construction Tracker
  19. Copy-and-swap For operator=。 有用
  20. Copy-on-write
  21. Intrusive reference counting (Counted Body)
  22. Covariant Return Types TODO
  23. Curiously Recurring Template Pattern (CRTP)
  24. Non-intrusive reference counting (Detached Counted Body) TODO
  25. Empty Base Optimization (EBO)
  26. enable-if               有用,but VS.net not support
  27. Envelope Letter TODO
  28. Erase-Remove        有用
  29. Execute-Around Pointer
  30. Exploding Return Type TODO
  31. Export Guard Macro TODO
  32. Expression-template 有用,表达式模板,用来延迟求值,生成树
  33. Fake Vtable TODO
  34. Fast Pimpl TODO
  35. Final Class    有用
  36. Free Function Allocators
  37. Function Object TODO
  38. Generic Container Idioms 有用,但不大
  39. Hierarchy Generation TODO
  40. Include Guard Macro
  41. Inline Guard Macro
  42. Inner Class
  43. Int-To-Type
  44. Interface Class
  45. Iterator Pair
  46. Making New Friends
  47. Metafunction
  48. Move Constructor
  49. Multi-statement Macro
  50. Member Detector
  51. Named Constructor
  52. Named External Argument TODO
  53. Named Loop (labeled loop)
  54. Named Parameter 有用,
  55. Named Template Parameters TODO
  56. Nifty Counter (Schwarz Counter)
  57. Non-copyable Mixin
  58. Non-member Non-friend Function TODO
  59. Non-throwing swap
  60. Non-Virtual Interface (NVI, Public Overloaded Non-Virtuals Call Protected Non-Overloaded Virtuals)
  61. nullptr
  62. Object Generator
  63. Object Template TODO
  64. Parameterized Base Class (Parameterized Inheritance)
  65. Pimpl (Handle Body, Compilation Firewall, Cheshire Cat)
  66. Policy Clone (Metafunction wrapper)
  67. Policy-based Design TODO
  68. Polymorphic Exception
  69. Polymorphic Value Types TODO
  70. Recursive Type Composition TODO
  71. Requiring or Prohibiting Heap-based Objects
  72. Resource Acquisition Is Initialization (RAII, Execute-Around Object, Scoped Locking)
  73. Resource Return
  74. Return Type Resolver
  75. Runtime Static Initialization Order Idioms
  76. Safe bool
  77. Scope Guard
  78. Substitution Failure Is Not An Error (SFINAE)
  79. Shortening Long Template Names TODO
  80. Shrink-to-fit
  81. Small Object Optimization TODO
  82. Smart Pointer
  83. Storage Class Tracker TODO
  84. Tag Dispatching TODO
  85. Temporary Base Class
  86. Temporary Proxy
  87. The result_of technique TODO
  88. Thin Template
  89. Traits TODO
  90. Type Erasure TODO
  91. Type Generator (Templated Typedef)
  92. Type Safe Enum
  93. Type Selection
  94. Virtual Constructor
  95. Virtual Friend Function
原文地址:https://www.cnblogs.com/zhoug2020/p/6270222.html