D mixins

Tom S h3r3tic at remove.mat.uni.torun.pl
Thu Jan 4 20:11:45 PST 2007


mike wrote:
> Am 05.01.2007, 00:19 Uhr, schrieb Waldemar <waldemar at wa-ba.com>:
> 
>>> >> Well coming from C++ this would not make much sense.  Where would you
>>> >> use them in C++?  Where would you use them in D?  Are there any 
>>> good D
>>> >> examples that show the power of mixins in a simple way that would be
>>> >> more ugly another way?
>>
>> Roughly speaking, anytime you see a multiline #define macro in C++ 
>> (especially
>> with parameters), you would use a mixin in D.
>>
>> That's only one sample use, but it should speak to the Cplusplusers.
>>
> 
> Erm ... I don't think you can insert this line via a mixin into a 
> certain scope:
> 
> ' scope (failure) dosomething();

It's just a wild guess, but... are you trying to get a backtrace of some 
sort ? If so, you might want to try the one from Shinichiro: 
http://shinh.skr.jp/d/


--
Tomasz Stachowiak



More information about the Digitalmars-d mailing list