L
Lilith
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?
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?