Hey all - my set class uses two vectors, data<int> and child<set*>. I keep getting a heap leak inside the assignment operator. I've been back and forth over this multiple times. I can get more info if needed, but I'm stuck! Thanks so much.
1 2 3 4 5 6 7 8 9 10 11 12 13
void set::operator =(const set& source)
{
if (this == &source) return; //Checks for self-assignment
clear();
data = source.data;
for (vector<set*>::size_type i = 0; i < source.child.size(); i++)
{
child.push_back(new set(*(source.child[i])));
}
}