Avatar of c_law
c_law

asked on 

C# overloading the = operator

I have a class A that has a ulong i property.

class DatabaseKeyBase
  {
    private ulong m_key = 0;

    public ulong Key
    {
      get { return this.m_key; }
      set { this.m_key = value; }
    }
  }

I want to overload the = operator so that the following happens
//Code
Class a, b;
a = b

I want the value i to be copied from b.i to a.i and not the the class pointing to the same reference.

Any ideas..
C#

Avatar of undefined
Last Comment
c_law

8/22/2022 - Mon