I have a class which has queue and map like below where astruct is a structure and aclass is a class. Should i initialise these in a constructor? Is so how do i do this? Thanks in advance
class A
{
queue<astrct*> m_testQueue;
map<int,aclass*> m_testmap;
A()
{};
}
I'll word it a bit differently: Your construct WILL always construct any sub-objects. If you don't specify a constructor via an initializer list*, they will be default constructed.
But as salem c said, this just means m_testQueue and m_testmap will be empty containers by default.