Comparing two structs using ==

前端 未结 6 849
萌比男神i
萌比男神i 2020-12-11 00:29

I am trying to compare two structs using equals (==) in C#. My struct is below:

public struct CisSettings : IEquatable
{
    public int Ga         


        
6条回答
  •  爱一瞬间的悲伤
    2020-12-11 00:37

    you must overload "==" operator, but also overload "!=" operator. (Look at this Note)

    For overloading operator, see this page

提交回复
热议问题