有人说the use of dynamic_cast often means bad design and dynamic_cast can be replaced by virtual functions 为什么使用dynamic_cast认为是不好的设计? 假设我有我的函数名func(Animal* animal, int animalType),在FUNC实现是这样的: bool func(
比方说,我有一个类家族所有实现相同的接口,也许是调度: class Foo : public IScheduler {
public:
Foo (Descriptor d) : IScheduler (d) {}
/* methods */
};
class Bar : public IScheduler {
public:
Bar (Descriptor
链接到原始问题Is it possible to get the index of class property?和雷米勒博和RRUZ program Demo;
{$APPTYPE CONSOLE}
uses
System.SysUtils, Winapi.Windows,
System.Rtti, System.TypInfo;
type
TMyCla