Scoped local variables

Marius Muja mariusm at cs.ubc.ca
Fri Dec 7 20:15:49 PST 2007


> Jason House wrote:
>> version=crash;
>> //version=work1;
>> //version=work2;
>> //version=work3;
>>
>> interface I{
>> }
>>
>> class C : public I{
>> }
>>
>> unittest{
>>         version(crash) scope I def = new C;
>>         version(work1) scope C def = new C;
>>         version(work2)       I def = new C;
>>         version(work3)       C def = new C;
>> }
>>
>> int main(){
>>         return 0;
>> }


Works fine on linux with gdc 0.24 and tango.


More information about the Digitalmars-d-learn mailing list