Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
c++0x pods and constructors
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jerry Coffin, post: 3967744"] In C++ 0x, the definition of POD no longer includes the requirement that the class be an aggregate. Instead, it introduces a couple of new terms, "standard layout class" and "trivial class". A POD has to be both. A user-defined constructor (by itself) does _not_ prevent the class from being a POD -- but you have to be really careful. In particular, a non-trivial copy constructor or non-trivial destructor _does_ prevent it from being a trivial class (IOW, copying with memcpy/memmove should work correctly). A standard layout class basically says it can't have virtual functions or virtual base classes, etc. As long as it fits both of those sets of restrictions, it's a POD. IOW, it _can_ have some "convenience ctors". Obviously I'm leaving out some of the details -- see N2960, §9/5, 9/6 for the full details. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
c++0x pods and constructors
Top