Why can't structs be derived from?

bearophile bearophileHUGS at lycos.com
Tue Mar 15 19:28:11 PDT 2011


Daniel Gibson:

> This check may make sense, but this cast could even work on 
> pointers-to-structs if they are similar, something like

I suggest to keep purposes separated, to keep the semantics of the program cleaner and to avoid some bugs, letting staticCast work with just objects.

A different function is for structs, that tests the first fields of the second struct are all present in the same order in the first struct :-)

Bye,
bearophile


More information about the Digitalmars-d mailing list