System.Rtti.TValue.From
Delphi
class function From<T>(const Value: T): TValue; inline; static;
C++
TValue __fastcall TValue::From(const T Value)
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Rtti.pas SystemRtti.h |
System.Rtti | TValue |
Description
Builds a new TValue record from a generic value.
From is a generic static method that can be used to build TValue records with a stored generic value. The Value parameter is stored inside the built TValue record.
To use TValue::From in previous-generation C++ compilers, you must call TValue::_op_Implicit()
instead of TValue::From<T>()
. You may use conditional compilation to support all C++ compilers:
#ifndef __clang__
MyValue v = TValue::_op_Implicit(MyVariable);
#else
MyValue v = TValue::From<T>(MyVariable);
#endif