Constructors are called when objects are created. Objects are created when the program runs, not at compile time. Why do you feel MyArray<6> myArray1; is more bloated than MyArray myArray1(6);?
Most of the STL is built on templates, so this becomes quite natural over time. The only reason I could see is that you are not used to the notation yet, but templates are just an important component of the language that it's worth familiarizing yourself with them.
Hope that helps, please do let us know if you have any further questions.
The compiler creates a new definition only when you create an instance of a template using type-parameters, not value-parameters. For instance:
1 2 3 4 5 6 7 8
template<typename T> //type parameter
array<int> int_array; //creates definition for array<int>
array<double> double_array; //creates a definition for array<double>
All you are passing to the template is a value which is always of type int, so the compiler has no reason to create a new definition. You may actually require to use this if you need multidimensional arrays. Have a look at the STL implementation documentation: http://www.cplusplus.com/reference/array/array/
Without dynamic allocation, I cannot think of a good way to treat all the arrays as the same type. The only way I can think of would be to make them all the same size. That is... make them all large enough for the largest array needed... and have those which do not need that extra space simply not use it. This is not memory efficient, but it's the only way I can think of to accomplish a uniform interface.
The only other thing I can think of is to employ some form of polymorphism (but this is difficult without dynamic allocation).
With templates, doesn't it generate separate class definitions? So the function code, getSize() in this case, is repeated each time a new template class is declared.
not quite: it generates types, and no, code is not generated for member functions of templates just because the template was declared, specialized, or instantiated: you need to actually be compiling source code that makes a call to the function (or, to be formal, ODR-uses it). And then, since it's a template, it will just get inlined, so cout << myArray2.getSize() will be compiled as cout << 9