Why retain new ?

Alex Burton alexibu at mac.com
Sun Aug 5 16:47:56 PDT 2007


Given that all classes are on the heap, why not replace the syntax :
CmdLin cl = new CmdLin(argc, argv);
with
CmdLin cl(argc,argv);
saving some typing and repetition.

Only when casting to base class would you want to do :
CmdLinBase cl = CmdLin(argc,argv);



More information about the Digitalmars-d mailing list