Re: is this a POD?
On 20.10.2010 10:32, salil wrote:
On Oct 19, 4:49 pm, Thomas Richter<t...@math.tu-berlin.de> wrote:
It also differs from Wikipedia's definition of a POD, where it
is said that PODs provide no encapsulation.
That looks wrong to me. PODs can provide encapsulation in a sense.
So long, Thomas
I am curious. Why do you say PODs provide encapsulation?
A POD type satisfies the following criteria in C++0x:
a) Triviality guarantees for special members.
b) Layout guarantees.
Both requirements restrict some form of encapsulation, but not all.
An important point to note is that layout is only marginally influenced
by access (The only reason why there is a layout constraint related to
access is to allow for implementations to allocate members first in
access order and second in lexical definition order), which
again means that there is no reason to assume that POD types could
not provide proper encapsulation.
Note that one particular POD condition of C++03 for severely constrained
encapsulation - the requirement to be an aggregate type - had been
lifted as result of applying
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2294.html
I recommend to consider the examples section that also points out
the design aim to allow for encapsulated POD types.
HTH & Greetings from Bremen,
Daniel Kr?gler
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]