TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  PCA#004Checked automatically with code checker

This rule is Obsolete
Synopsis:Do not use structures as replacement for classes
Language:C++
Severity Level:7
Category:Parts of C++ to Avoid


Description:

In C++ a structure is pretty much the same as a class with the only difference that the default member access of a structure is public and that of a class is private. However, structures may not be used as replacements for classes. They may only be used in places where you would use a plain-old 'C' structure. Everything the C++ language has added to structures may not be used. In other words, a structure does not have methods or operators, does not have access specifiers (public, protected, private), does not have friends etc.