Implement a class with mixins
pragma
pragma_member at pathlink.com
Mon May 8 10:45:53 PDT 2006
In article <e3nr1u$1ekk$1 at digitaldaemon.com>, Sean Kelly says...
>
>Don Clugston wrote:
>>
>> In every case I've seen or dreamt up so far, a template is either
>> intended to be a mixin, or not. Is that your experience too?
>
>Yes.
>
>> I suspect that 'mixin' should be specified in the template declaration,
>> rather than just the instantiation.
>
>Perhaps it should, though I'm hesitant to suggest a special declaration
>syntax unless it offers something over the current approach.
Personally, I just use the 'M' suffix convention (in place of 'T') to avoid
confusing myself with what's a type template and what is a mixin.
But I do agree with the point made, that it would be nice to restrict the usage
of templates according to their intended purpose. Offhand, I can't think of a
single type template that would be useful in the same context as your typical
mixin (or vice-versa). However, I'm hesitant to agree that using 'mixin' in the
declaration is the answer - do we still require the 'auto' modifier for auto
class declarations?
- EricAnderton at yahoo
More information about the Digitalmars-d
mailing list