We can define type for normal procedure or method, like

We can define type for normal procedure or method, like
type t = procedure(x: integer) of object;

But is there way to define type for constructor?

type c = constructor(...) not compiles.

Comments

  1. David Heffernan When we write p := @StrtoFloat we don't know which of overloaded StrtoFloat functions will be in p. Standatd solution is to declare type:
    TStrtoFloat = function(const s: string): extended;
    var p: TStrtoFloat;
    ,,,
    p := StrtoFloat;

    Now I want the same but for constructors - distinct betwen several overloaded constructors.

    ReplyDelete
  2. And yet you just said that you always want the constructor with the single TComponent argument.

    And what you just said isn't really anything like what is in the original post. Still feels like an XY to me.

    ReplyDelete
  3. Alexander Sviridenkov As David is saying, why do (you think) you need constructor references?

    ReplyDelete

Post a Comment