Avatar of 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
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..

Avatar of undefined
Last Comment

8/22/2022 - Mon