I have a template to create instance of various objects. The template has a static array of class declaration which is supposed to create an array of class type being passed during its creation.
In below example myclass is the static array of class object with size 200 - which can be bigger also. Note that the template can be instantiated with different objects - so the type of array will also be changed accordingly.
How can initialize the static array during declaration itself - I understand that we need to initialize static array when defined itself, what if the size if more bigger -
template <class object>
A<object> myclass[200] = { .... new object 200 times...};
or I need it to do it new / delete overloaded operator as defined in template? In such a case how will the array of objects construction & destruction will occur? What if some object references the array as they are static before template instantiation?