More C++ Idioms

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Contents

[edit] Foreword

More C++ Idioms C++ has indeed become too "expert friendly" --- Bjarne Stroustrup.

It is true because experts are intimately familiar with the idioms in the language. The more idioms a programmer absorbs, the friendlier the language becomes to him/her. The objective of this open content book is to help elevate the knowledge of programmers who have moderate level of familiarity with C++ to a level where C++ feels much friendlier to them. It is designed to be an exhaustive catalog of reusable idioms that expert C++ programmers often use while programming/designing with C++. This is an effort to capture their techniques and vocabulary into a single work. This book describes the idioms in a regular format: Name-Intent-Motivation-Solution, which is succinct and helps learning faster.

The world is invited to catalog reusable pieces of C++ knowledge (similar to the book on patterns by GoF). The goal here is to first build an exhaustive catalog of modern C++ idioms and later evolve it into an idiom language, just like a pattern language. Finally, the contents of this book can be redistributed under the terms of the GNU Free Documentation License.

Aimed toward: Anyone with a moderate level of knowledge in C++ and supported language paradigms

[edit] More Information

Authors | Guidelines for Authors | GNU Free Documentation License

RSS Logo

More C++ Idioms RSS


[edit] Table of Contents

  1. Policy Clone
  2. Coercion by Member Template
  3. Scope Guard
  4. Meta-function wrapper
  5. Expression-template
  6. Non-copyable Mixin
  7. Curiously Recurring Template Pattern
  8. Parameterized Base Class
  9. Parameterized Inheritance
  10. Move Constructor
  11. Safe bool
  12. Base-from-Member
  13. Construction Tracker
  14. Runtime Static Initialization Order Idioms
  15. Construct On First Use
  16. Nifty Counter
  17. Schwarz Counter
  18. Calling Virtuals During Initialization
  19. Execute-Around Pointer
  20. Thin Template
  21. Dynamic Binding During Initialization
  22. Non-throwing swap
  23. Copy-and-swap
  24. Shrink-to-fit
  25. Clear-and-minimize
  26. Erase-Remove
  27. Smart Pointer
  28. Const auto_ptr
  29. Checked delete
  30. Inner Class
  31. Iterator Pair
  32. Resource Return
  33. nullptr
  34. Generic Container Idioms
  35. Include Guard Macro
  36. Inline Guard Macro
  37. Multi-statement Macro
  38. Making New Friends
  39. Resource Acquisition Is Initialization
  40. Execute-Around Object
  41. Scoped Locking
  42. Interface Class
  43. Capability Query
  44. Handle Body
  45. Pimpl
  46. Cheshire Cat
  47. Compilation Firewall
  48. Counted Body (intrusive reference couting)
  49. Reference Counting (intrusive)
  50. Detached Counted Body (non-intrusive reference couting)
  51. Envelope Letter
  52. Delegated Polymorphism
  53. Virtual Constructor
  54. Concrete Data Type
  55. Non-Virtual Interface
  56. Named Constructor
  57. Named Parameter
  58. Polymorphic Exception
  59. Public Overloaded Non-Virtuals Call Protected Non-Overloaded Virtuals
  60. Virtual Friend Function
  61. SFINAE
  62. Substitution Failure Is Not An Error
  63. Fast Pimpl
  64. Tag Dispatching
  65. Enable If
  66. Traits
  67. Non-member Non-friend Function
  68. Barton-Nackman trick
  69. Storage Class Tracker
  70. Fake Vtable
  71. Overload Set Creation
  72. Address Of
  73. Compile Time Control Structures
  74. Type Selection
  75. Temporary Base Class
  76. Computational Constructor
  77. Type Safe Enum
  78. Attach by Initialization
  79. Object Template
  80. Non-member get
  81. Named External Argument
  82. Forward Declare First
  83. Function Object
  84. Examplar
  85. Policy-based Class Design
  86. Boost mutant
  87. Multiple Member Initialization
  88. Friendship and the Attorney-Client
  89. Trailing Parens for Method Chaining for Named parameter
  90. Final Class
  91. Copy-on-write
  92. Shortening Long Template Names
  93. Export Guard Macro


Wikibook Development Stages
Sparse text Image:00%.svg Developing text Image:25%.svg Maturing text Image:50%.svg Developed text Image:75%.svg Comprehensive text: Image:100%.svg
Infobox/More C++ Idioms
Personal tools
In other languages