Hello,

Any idea how I know if a class, in a class pointer, overrides a virtual method? Eg:

tfooclass = class of tfoo;

tfoo = class
  procedure sample; virtual;
end;

tboo1 = class(tfoo)
end;

tboo2 = class(tfoo)
  procedure sample; override;
end;

...

vfooclass := tboo1;
// vfooclass doesn't implement sample.

vfooclass := tboo2;
// vfooclass implements sample.

At this moment I know that:

1. I could cast a method pointer with tmethod if sample was a class method;

2. I could cast this same method pointer if I had an instance of vfooclass.

But is there another way beyond creating an instance?

Thanks.

--
Joao Morais
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to