From a4502a50d5d97f7ecdf598de708dceb0e3fc2264 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 31 Aug 2015 12:03:55 +0000 Subject: [PATCH] * Added TArray generic git-svn-id: trunk@31462 - --- rtl/objpas/objpas.pp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rtl/objpas/objpas.pp b/rtl/objpas/objpas.pp index 55bde0bc8d..198c6d26f2 100644 --- a/rtl/objpas/objpas.pp +++ b/rtl/objpas/objpas.pp @@ -19,11 +19,11 @@ {$endif} unit objpas; - interface +interface - { first, in object pascal, the integer type must be redefined } + { first, in object pascal, the integer type must be redefined } {$ifdef CPU16} - const + const MaxInt = MaxSmallint; type Integer = smallint; @@ -57,7 +57,15 @@ unit objpas; TBoundArray = array of integer; + {$if FPC_FULLVERSION >= 20701} + + { Generic array type. + Slightly Less useful in FPC, since dyn array compatibility is at the element level. + But still useful for generic methods and of course Delphi compatibility} + + Generic TArray = Array of T; + { Generic support for enumerator interfaces. These are added here, because mode (Obj)FPC does currently not allow the overloading of types with generic types (this will need a modeswitch...) }