Andrey Semashev
unread,Jan 14, 2017, 8:21:33 AM1/14/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ISO C++ Standard - Discussion
Hi,
Reading the standard, I'm confused as to how classes and fundamental
types are related. [class]/1 says that class is a type and then goes on
to specify what a class-name is and how classes are defined (i.e. using
class-key class, struct or union).
This definition seems to exclude the fundamental types like int or
enums. If that's the case, the following definitions of
trivially-copyable, trivial, standard-layout classes and POD struct do
not apply to those types. Does that mean that fundamental types and
enums are not considered trivial, standard-layout or POD?
Also, in the POD-struct definition ([class]/10) there is an example that
shows that trivial, standard-layout and POD types can have ints. So it
seems that the intention is to include at least fundamental types into
the notion of a class. It's not clear about enums though.
So the question is, are fundamental types and enums also considered
classes or is there a defect in the example?