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++
Default construction of arrays of PODs using new
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="Bjarke Hammersholt Roune, post: 4058627"] So I guess you are not right, if T is zero-initialized then all its POD Interesting answer to the third question - this introduces another concept: zero-initialization. If what I wrote for the first two questions is correct, then no zero-initialization occurs, since what I wrote was all about the default constructor being called or not. In that case zero-initialization isn't relevant to the question, since zero-initialization isn't what happens in the two lines I wrote, even if the result of calling the default constructors would be the same as zero-initialization for the case that A=int. However, it is also possible that I was wrong and what happens when you write A* a = new A[10]; or perhaps A* a = new A[10](); is zero-initialization and not default construction. In that case it certainly is relevant. I now know more but am more confused! :) Cheers Bjarke Hammersholt Roune [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Default construction of arrays of PODs using new
Top