A base class is a type of class that is used to inherit member variables and member functions from.
Or: a base class is the entity that all derived classes share.
A special type of base class is the abstract base class.
- All base classes must have a (public) virtual destructor [1]
- Avoid member variables in base classes intended as interfaces [2]
- Use base classes with member variables to support implementation inheritance [3]
-
- Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 50: 'Make base class destructors public and virtual, or protected and nonvirtual'.
-
- Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 21.4. Advice. page 640: '[2] Avoid data members in base classes intended as interfaces'
-
- Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 21.4. Advice. page 640: '[7] Use base classes with data members to support implementation inheritance'