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="Howard Hinnant, post: 2988403"] Which sounds like I might get the guarantee I want someday. It also implies that I can do it now and chances are that it will work. I have a question, based upon the link you gave. Wouldn't it be easier to enforce structs to be PODs? That is, just disallow anything in a struct that is a party spoiler in regards to layout and size. In still other words, don't allow structs to be classes and let the compiler warn when an attempt is made to declare or derive or compose illegally. As long as structs are allowed to evolve into classes, a lot of programmer productivity goes out the window.[/QUOTE] I'd probably vote for that in a new language. But not in a revision to C++. It would break too much code. -Howard [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Why can't PODs have constructors?
Top