Irritating shortcoming with modules and externs

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed May 17 08:24:00 PDT 2006


"Mike Parker" <aldacron71 at yahoo.com> wrote in message 
news:e4ed7h$162h$2 at digitaldaemon.com...
> Mike Parker wrote:
>
>>
>> How about this:
>>
>> ##########################################
>> // main.d
>> module main;
>>
>> abstract class Context
>> {
>> public:
>>     abstract void run(char[][] args);
>>     protected:
>>     this()
>>     {
>>         theContext = this;
>>     }
>> }
>>
>
> Of course, there should be a null check in the constructor so that only 
> one primary cotext is ever set:
> if(theConext is null)
> theContext = this;

Oh that's really cool :)  I might go with that. 





More information about the Digitalmars-d-learn mailing list