change mixins

BCS none at anon.com
Mon Feb 15 10:56:33 PST 2010


Hello Jonathan,

> BCS wrote:
> 
>> Hello Jonathan,
>> 
>>> (I don't know why you'd want the name in the first place),
>>> 
>> mixin foo!(int) asInt;
>> mixin foo!(float) asFloat;
>> Without the names you can't access anything.
>> 
> Well, I obviously need to read up on mixins again. I don't have any
> clue why you'd ever want to access them. I thought that they were just
> replaced with the code that they contain, and I don't know what you'd
> be trying to access. I'll have to go read the documentation again...
> 

Mixins (of that kind) are replaced by the contents of the template. Because 
templates only contain declarations, unless you access them, all you end 
up doing (RAII like cases aside) is adding unreferenced variables/functions/etc.

-- 
<IXOYE><





More information about the Digitalmars-d mailing list