System.Rtti.TValue.IsType

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function IsType<T>(const EmptyAsAnyType: Boolean = True): Boolean; overload; inline;
function IsType(ATypeInfo: PTypeInfo; const EmptyAsAnyType: Boolean = True): Boolean; overload;

C++

bool __fastcall TValue::IsType(const bool EmptyAsAnyType)/* overload */
bool __fastcall IsType(System::Typinfo::PTypeInfo ATypeInfo, const bool EmptyAsAnyType = true)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Rtti.pas
SystemRtti.h
System.Rtti TValue

Description

Checks whether the currently stored value can be casted to a given type.

Call IsType to check whether the stored value is of the given type. IsType requires one parameter, ATypeInfo, which represents the type information to check against. IsType returns true if the stored value is of the checked type, and false otherwise.

The generic variant of this method does not require any parameters, because is obtains the PTypeInfo information internally.

See Also