Is Demo a POD type in C++03?
struct Demo
{
private:
int x;
int y;
};
C++03, §9p4:
A POD-struct is an aggregate class that has no non-static data members of type non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined copy assignment operator and no user-defined destructor.
After reading Steve Jessop's post, I believe Demo is a non-POD because the members are private. However the Standard doesn't say anything about the relation between POD types and access modifiers.
In C++0x Demo is POD because §9p9 (n3126) says:
A POD struct is a class that is both a trivial class and a standard-layout class, and has no non-static data members of type non-POD struct, non-POD union (or array of such types).
Demo is trivial1 as well as a standard-layout class so it is a POD. Is my interpretation correct?
1 A trivial class is a class that has a trivial default constructor (12.1) and is trivially copyable. [9p5, n3126]