How I declare my class and why -- Howard Hinnant
An experience-based opinion piece from one of the masters of C++:
How I declare my classes and why
by Howard Hinnant
Howard is the lead designer and author of move semantics, and a longtime C++ committee member where he has served as chair of the Library Working Group and is a current member and recent chair of the Direction Group.
From the article:
When I'm reading a class declaration, the very first things I want to know are:
- What resources does this class own?
- Can the class be default constructed?
- Can the class be copied or moved?
- How can the class be constructed (other than by default, copy or move)?
- What else can one do with the class?
Note that this is an ordered list...