パスワードを忘れた? アカウント作成
473844 journal

kogepanmanの日記: [VB.NET] Dictionary(Of TKey, TValue)でちょっとはまった

日記 by kogepanman
TKeyに自作のクラスを使用する場合は、そのクラスでIEquatableを実装しないとContainsKey()がおかしくなる。

Public Class Elm
        Implements IEquatable(Of Elm)

        Public xid As String
        Public eid As String

        Public Function Equals1(ByVal other As Elm) As Boolean Implements System.IEquatable(Of Elm).Equals
                Return xid = other.xid And eid = other.eid
        End Function
End Class
typodupeerror

犯人はmoriwaka -- Anonymous Coward

読み込み中...