More C++ Idioms
From Wikibooks, the open-content textbooks collection
Contents |
[edit] Foreword
| 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
[edit] Table of Contents
- Policy Clone
- Coercion by Member Template
- Scope Guard
- Meta-function wrapper
- Expression-template
- Non-copyable Mixin
- Curiously Recurring Template Pattern
- Parameterized Base Class
- Parameterized Inheritance
- Move Constructor
- Safe bool
- Base-from-Member
- Construction Tracker
- Runtime Static Initialization Order Idioms
- Construct On First Use
- Nifty Counter
- Schwarz Counter
- Calling Virtuals During Initialization
- Execute-Around Pointer
- Thin Template
- Dynamic Binding During Initialization
- Non-throwing swap
- Copy-and-swap
- Shrink-to-fit
- Clear-and-minimize
- Erase-Remove
- Smart Pointer
- Const auto_ptr
- Checked delete
- Inner Class
- Iterator Pair
- Resource Return
- nullptr
- Generic Container Idioms
- Include Guard Macro
- Inline Guard Macro
- Multi-statement Macro
- Making New Friends
- Resource Acquisition Is Initialization
- Execute-Around Object
- Scoped Locking
- Interface Class
- Capability Query
- Handle Body
- Pimpl
- Cheshire Cat
- Compilation Firewall
- Counted Body (intrusive reference couting)
- Reference Counting (intrusive)
- Detached Counted Body (non-intrusive reference couting)
- Envelope Letter
- Delegated Polymorphism
- Virtual Constructor
- Concrete Data Type
- Non-Virtual Interface
- Named Constructor
- Named Parameter
- Polymorphic Exception
- Public Overloaded Non-Virtuals Call Protected Non-Overloaded Virtuals
- Virtual Friend Function
- SFINAE
- Substitution Failure Is Not An Error
- Fast Pimpl
- Tag Dispatching
- Enable If
- Traits
- Non-member Non-friend Function
- Barton-Nackman trick
- Storage Class Tracker
- Fake Vtable
- Overload Set Creation
- Address Of
- Compile Time Control Structures
- Type Selection
- Temporary Base Class
- Computational Constructor
- Type Safe Enum
- Attach by Initialization
- Object Template
- Non-member get
- Named External Argument
- Forward Declare First
- Function Object
- Examplar
- Policy-based Class Design
- Boost mutant
- Multiple Member Initialization
- Friendship and the Attorney-Client
- Trailing Parens for Method Chaining for Named parameter
- Final Class
- Copy-on-write
- Shortening Long Template Names
- Export Guard Macro
| Wikibook Development Stages | ||||
|---|---|---|---|---|
| Sparse text |
Developing text |
Maturing text |
Developed text |
Comprehensive text: |

