Add TValue.FromOrdinal to RTTI
Original Reporter info from Mantis: rd0x
-
Reporter name:
Original Reporter info from Mantis: rd0x
- Reporter name:
Description:
FPC misses TValue.FromOrdinal functionality
Steps to reproduce:
try to run code from http://softwareonastring.com/147/how-to-store-enums-without-losing-your-coding-freedom in 'Generics with extended RTTI' section and it will fail due to missing function
Additional information:
class function TValue.FromOrdinal(ATypeInfo: PTypeInfo; AValue: Int64): TValue;
begin
if (FData.FTypeInfo=nil) or not (FData.FTypeInfo^.Kind in [tkInteger, tkChar, tkWChar, tkEnumeration, tkInt64]) then
raise Exception.CreateFmt(SErrUnableToGetValueForType,[ATypeInfo^.Name]);
TValue.Make(@AValue, ATypeInfo, Result);
end;
Mantis conversion info:
- Mantis ID: 35687
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 42221 (#253f65c5)