Changeset 519
- Timestamp:
- Jun 10, 2008, 11:46:25 PM (16 years ago)
- Location:
- trunk/ab5.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/List.ab
r396 r519 25 25 26 26 Sub Realloc( allocateSize As Long ) 27 items = realloc( items, allocateSize * SizeOf( VoidPtr) )27 items = realloc( items, allocateSize * SizeOf(T) ) 28 28 End Sub 29 29 … … 46 46 Function Operator[] ( index As Long ) As T 47 47 Return items[index] 48 End Function 49 50 /*! 51 @brief ポインタ型へのキャスト 52 @author Daisuke Yamamoto 53 @date 2007/08/22 54 @param インデックス 55 */ 56 Function Operator() As *T 57 Return items 48 58 End Function 49 59 … … 112 122 Sub Insert( index As Long, item As T ) 113 123 Realloc( size + 1 ) 114 memmove( items + (index+1)*SizeOf( VoidPtr), items + index*SizeOf(VoidPtr), (size-index)*SizeOf(VoidPtr) )124 memmove( items + (index+1)*SizeOf(T), items + index*SizeOf(T), (size-index)*SizeOf(T) ) 115 125 items[index] = item 116 126 size++ … … 140 150 */ 141 151 Sub RemoveAt( index As Long ) 142 memmove( items + index*SizeOf( VoidPtr), items + (index+1)*SizeOf(VoidPtr), (size-(index+1))*SizeOf(VoidPtr) )152 memmove( items + index*SizeOf(T), items + (index+1)*SizeOf(T), (size-(index+1))*SizeOf(T) ) 143 153 Realloc( size - 1 ) 144 154 size--
Note:
See TracChangeset
for help on using the changeset viewer.