MISRA Discussion Forums
11.0.1 and static data members - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18)
+--- Forum: MISRA C++:2008 rules (https://forum.misra.org.uk/forumdisplay.php?fid=19)
+---- Forum: 6.11 Member access control (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=140)
+---- Thread: 11.0.1 and static data members (/showthread.php?tid=1263)



11.0.1 and static data members - grunwald - 08-07-2016

Does 11.0.1 "Member data in non-POD class types shall be private." apply to all data members, or only non-static data members?

In particular, I'm interested whether the constant in this code violates 11.0.1:

Code:
class MyClass {
    std::string non_pod_class;
public:
    static const int CONSTANT = 10;
};

const int MyClass::CONSTANT;



Re: 11.0.1 and static data members - misra cpp - 11-10-2016

This rule applies to all data members, including statics