thanks all,

I think i am understand, if the closest solution is template,
there is no solution in D for my code like this.

type
      TMyObjectClass = class of TMyObjectA;

var
      ClassArray : array of TMyObjectClass; //the content
initialized
randomly
      ObjectArray : array of TMyObjectA;
      i, j : Integer;

procedure CreateAllObject;
begin
      J:= length(ClassArray);
      for I:= 0 to J do begin
        ObjectArray[I]:= ClassArray[I].Create({some argument});
      end;
end;

if D unable to do this, I think we must do something with D.

I'm still thinking, why constructor in D adopt C++ style rather
than pascal style, while pascal style is better :-?

Reply via email to