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++
Why can't PODs have 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: 2986951"] The definition of PODs was _intended_ to support two separate things: 1) static initialization, and 2) layout compatibility with C. Allowing ctors wouldn't (at least as things are normally implemented) affect layout compatibility with C. It could, however, remove the possibility of static initialization. OTOH, I think this requirement could be loosened somewhat without any problem: at the very least, I believe a ctor that contained only an intialization list (no body) and all the initialization values were constant expressions could still support static initialization. A body that did essentially the same things (simple assignments, rvalues are all constant expressions) would be easy to support as well. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Why can't PODs have constructors?
Top