Neo wrote in message ...
>No I dont have any pointers but fully instantiated container object and
other objects.
class game{
public:
game();
game( int screen );
private:
std::vector<std::vector<int grid; // 2D
std::vector<doublevgrid; // will be default inited.
} ;
// init a 10x10 'grid' in the initializer list.
size_t Wi(10), Hi(10);
game::game( int screen ) : grid( Wi,
std::vector<int>( Hi, int( screen ) ) ){ // int() for doc'
// if 'vgrid' were not default constructed, the next line would fail.
vgrid.push_back( 3.1415 );
std::cout << grid.at( 9 ).at( 9 ); // last element
} // game::game(int) Ctor
It isn't 'required'[1], but, it is a C++ sin to not init if you can. <G>
So, now you have the choice.
As Shake Spear said, "To init, or not to init. That is the question....".
Does that answer your question, had you asked one?
[1] - references do.
--
Bob R
POVrookie