Kagamin пишет:
Weed Wrote:
that is, suppose that after some action should get a matrix matrix3x1
Well... if you want to template every piece of your code, this can
cause disaster, so I think, this is not very good design. For
example, multiplication method will be duplicated N*N*N times for all
possible matrix size combinations.
Only for really used combinations (i am using "duck typing" inside
templates).
In any case, unused functions in the resulting file is not included.
I'd prefer run-time checks, though
templates can be used for sure.
This problem would help solve the availability of inheritance for
structs or compile-time creation of class instances.
But now the compiler can identify duplicate parts of the code, working
with the same types