Why cannot scopes be used in template mixins?

Justin Johansson no at spam.com
Tue Oct 19 04:55:36 PDT 2010


On 19/10/2010 10:31 PM, Stanislav Blinov wrote:
> 19.10.2010 14:18, Justin Johansson wrote(ln):
>> For example:
>>
>> private string THIS_MODULE_NAME = "abc.def";
>>
>> mixin template MyCorporationStandardUnitTest()
>> {
>> scope(success) {
>> writeln( THIS_MODULE_NAME ~ " unittest passed");
>> }
>>
>> scope(failure) {
>> writeln( THIS_MODULE_NAME ~ " unittest failed");
>> }
>> }
>>
>>
>> I think the D spec does not say this is allowed, but why not?
>>
>> Thanks in advance for answers,
>>
>> Justin
>>
> How would that behave when mixed in class/struct definition?

You would not use it if it was not appropriate.




More information about the Digitalmars-d mailing list