(C++) protected

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) protected

 

protected is a keyword to a class its access level to protected or for protected inheritance.

 

 

 

 

 

Examples

 

 

 

 

 

 

Advice

 

 

 

 

 

References

 

  1. Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 20.7. Advice. page 611: '[12] Use protected members only carefully when really needed'
  2. Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 20.7. Advice. page 611: '[13] Don't declare data members protected'