Conditional behaviour based on concrete type for generic class

后端 未结 4 1797
北恋
北恋 2020-12-06 05:06

Since my question from yesterday was perhaps not completely clear and I did not get the answer I wanted, I will try to formulate it in a more general way:

Is there a

4条回答
  •  醉酒成梦
    2020-12-06 05:59

    You can fall back to RTTI, by using TypeInfo(T) = TypeInfo(string). To test to see if something is a class, you could use something like PTypeInfo(TypeInfo(T))^.Kind = tkClass.

    The PTypeInfo type and tkClass enumeration member are defined in the TypInfo unit.

提交回复
热议问题