struct inheritance need?

Weed resume755 at mail.ru
Mon Dec 22 05:49:10 PST 2008


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


More information about the Digitalmars-d-learn mailing list