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++
Order of construction
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="Lilith, post: 3475603"] Does the standard define in what order components of a class are instantiated? I created a class called Grid that has a M x N array. Each element of this 2D array is a structure that has it's own constructor. The Grid constructor does its own initialization of the members of the 2D array but apparently the constructor for the elements of array comes in after this and changes that to whatever the constructor for the struct says it should be. I would imagine that in order for the Grid constructor to be able to act on the 2D array the 2D array itself would have had to have been instantiated before the Grid constructor kicked in. Any insight on whether there's a mandated order for these things? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Order of construction
Top