On Thu, 19 Mar 2009 18:06:37 +0100, KeepYourMind <[email protected]> 
wrote:

Sean Kelly Wrote:

KeepYourMind wrote:
>
> What i need to do for pizza.doSomeA() begin work?

cast pizza to CoolPizza.

Problem is i dont know what class returned. "char[] name" is dynamic and getting from command-line arguments.

Then you need some test to see if it really is a CoolPizza.

void main( string[] args ) {
   auto pizza = PizzaFactory.factory( args[1] );
   pizza.doSome( );
   if ( args[1] == "CoolPizza" ) {
       ( cast( CoolPizza ) pizza ).doSomeA( );
   }
}

Reply via email to