title: Error: No viable overloaded =
body: <p>I have a class which looks like this:</p>
  
  <pre><code>class MemberListEntry {
  public:
      int id;
      short port;
      long heartbeat;
      long timestamp;
      MemberListEntry(int id, short port, long heartbeat, long timestamp);
      MemberListEntry(int id, short port);
      MemberListEntry(): id(0), port(0), heartbeat(0), timestamp(0) {}
      MemberListEntry(const MemberListEntry &amp;anotherMLE);
      MemberListEntry&amp; operator =(const MemberListEntry &amp;anotherMLE);
      int getid();
      short getport();
      long getheartbeat();
      long gettimestamp();
      void setid(int id);
      void setport(short port);
      void setheartbeat(long hearbeat);
      void settimestamp(long timestamp);
  };
  </code></pre>
  
  <p>The I have some code which instantiates it like this:</p>
  
  <pre><code>   int id = stoi(address.substr(0, pos));
     short port = (short)stoi(address.substr(pos + 1, address.size()-pos-1));
     memcpy(&amp;addr[0], &amp;id, sizeof(int));
     memcpy(&amp;addr[4], &amp;port, sizeof(short));
  
    MemberListEntry mEntry;
    mEntry = new MemberListEntry(id, port);
  </code></pre>
  
  <p>I am getting this error:</p>
  
  <pre><code> error: no viable overloaded '='
   mEntry = new MemberListEntry(id, port);
  </code></pre>
  
  <p>Any idea what could be the cause of the issue?</p>