Walter's second axiom

Janice Caron caron800 at googlemail.com
Tue Dec 11 23:25:15 PST 2007


On Dec 11, 2007 11:57 PM, Jason House <jason.james.house at gmail.com> wrote:
> Can you please share with us all the advantages of "Any type T can be
> wrapped inside a struct S, and that S can be made to behave as a typedef
> for type T."
>
>
> Under what conditions can it behave exactly like a typedef?  If it behaves
> *exactly* as a typedef under all circumstances, then it can't have any
> additional data members or member functions and must behave exactly like
> the original.  If that's true, why wrap it in a struct at all?

It's the difference between CAN and MUST. The idea that it is
/possible/ to make a type which emulates another type. But no one ever
said it was compulsory.



More information about the Digitalmars-d mailing list