Ignore:
Timestamp:
Sep 22, 2008, 5:31:01 AM (16 years ago)
Author:
NoWest
Message:

List<T>、Stack<T>、Queue<T>を相互にIEnumerator<T>を使って変換できるようにしました。

List<T>クラスからReadOnlyCollectionの呼び出しがコンパイルできません。
どうしても問題を再現できなかったので、皆さんの所でも問題が発生するか確認のためにupしておきます。
やっぱり問題がおきたら、RevertするかListのAsReadOnlyメソッドをコメントアウトしてください。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/Stack.ab

    r607 r631  
    1515    End Sub
    1616
     17    Sub initialize()
     18        This.items = GC_malloc(1)
     19    End Sub
    1720Public
    1821    Sub Stack ()
    19         This.items = GC_malloc( 1 )
     22        This.initialize()
    2023    End Sub
    2124
    2225    Sub Stack ( capacity As Long )
    23         This.items = GC_malloc( 1 )
     26        This.initialize()
    2427        If capacity > 0 Then
    2528            This.size = capacity
    2629            Realloc(capacity)
    2730        End If
     31    End Sub
     32
     33    Sub Stack ( enumerator As IEnumerator<T> )
     34        This.initialize()
     35        While enumerator.MoveNext()
     36            This.Push(enumerator.Current())
     37        Wend
    2838    End Sub
    2939
Note: See TracChangeset for help on using the changeset viewer.