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/Queue.ab

    r607 r631  
    1515    End Sub
    1616
     17    Sub initialize()
     18        This.items = GC_malloc(1)
     19    End Sub
     20
    1721Public
    1822    Sub Queue ()
    19         This.items = GC_malloc( 1 )
     23        This.initialize()
    2024    End Sub
    2125
    2226    Sub Queue ( capacity As Long )
    23         This.items = GC_malloc( 1 )
     27        This.initialize()
    2428        If capacity > 0 Then
    2529            This.size = capacity
    2630            Realloc(capacity)
    2731        End If
     32    End Sub
     33
     34    Sub Queue ( enumerator As IEnumerator<T> )
     35        This.initialize()
     36        While enumerator.MoveNext()
     37            This.Enqueue(enumerator.Current())
     38        Wend
    2839    End Sub
    2940
Note: See TracChangeset for help on using the changeset viewer.