Assignment Operators

Does anyone know how to implement these header declarations?

1
2
3
Set(Set); // Copy constructor

operator=(Set s); // Supposedly assignment operator 


Also, the data members include datatype int: elements and size. I'm defining a class called Set that stores integers in a dynamically allocated array of integers. I'm supplying big three memory management functions, and the above two declarations are among them.
Last edited on
closed account (3hM2Nwbp)
1
2
3
4
5
6
Set::Set(const Set& rhs)
{
/// do copy
}
///...or if the copy constructor is trivial:
Set(const Set&) = default; /// in your header 

Similar for assignment, but check for unsafe self-assignment.
Topic archived. No new replies allowed.