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="James Kanze, post: 3972398"] [...] In practice, with most compilers, yes. The current standard doesn't talk about "layout-compatible", and no C++ standard can impose anything on the C compiler. I didn't see anything in N2914 (the latest draft that I happen to have handy) that guaranteed that a "standard-layout" class is in anyway compatible with C. On the other hand, the whole concept of "layout-compatible" seems to have been lifted from the C standard, and from a QoI point of view, I would expect that anything with "standard-layout" be compatible with C if the system defines a standard C ABI (as most do). Per se, they don't have much use. They do restrict the implementation in some ways, however, that typically allows them to be used in mixed language headers (headers which are used by both C and C++). Nothing. Otherwise, the constructor wouldn't be trivial. I'm not sure what you're trying to ask there, but if it is "why do we need a special syntax for this?", it's because the current standard says that if a class has any constructor, the compiler won't provide a default constructor implicitly, and a lot of code counts on this. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
c++0x pods and constructors
Top