[MECpp]Item-6 Distinguish Between Prefix and Postfix Forms of Increment and Decrement Operators
· โ˜• 3 min read

The prefix and postfix forms of increment and decrement operators return different types: prefix forms return a reference, while postfix forms return a const object. For efficiency, prefer prefix forms unless the behavior of postfix ones is necessary. To guarantee consistency, implement postfix operators in terms of the prefix operators.


[MECpp]Item-4 Avoid Gratuitous Default Constructors
· โ˜• 5 min read

Including meaningless default constructors affects the efficiency of classes, so avoiding them in classes guarantees fully-initialized objects, with the cost of some limits on how such classes can be used.


[MECpp]Item-1 Distinguish Between Pointers and References
· โ˜• 3 min read

More effective C++: Use references when we already have something to refer to and never want to refer to anything else, or when implementing operators whose syntactic requires us to do so.