Irritating shortcoming with modules and externs

Mike Parker aldacron71 at yahoo.com
Tue May 16 22:49:19 PDT 2006


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;



More information about the Digitalmars-d-learn mailing list