How to determine if two generic type values are equal?

前端 未结 7 2206
忘掉有多难
忘掉有多难 2021-02-08 13:29

Update* I am so sorry... my sample code contained an error which resulted in a lot of answers I didn\'t understand. In stead of

Console.WriteLin         


        
相关标签:
7条回答
  • 2021-02-08 14:05

    To elaborate on Gideon's answer (please upvote his, not mine): the method you defined has signature

    bool GenericOjbect<T>::Equals( T )
    

    While your code is calling

    bool GenericOjbect<T>::Equals( GenericOjbect<T> )
    

    which is inherited (not overridden) from Object.

    0 讨论(0)
提交回复
热议问题