|
-
September 25th, 2010, 05:08 PM
#7
Re: Queue Copy Constructor - segfault?
 Originally Posted by mayabelle
Ok, point understood. I will fix that, but in the meantime I want to at least be able to run the program...
To make sure your program isn't making assignments:
Code:
class Queue
{
private:
Queue& operator=(const Queue&);
//...
};
Recompile your code with this added definition (it must be private:). If you get a compiler or linker error that something is attempting to assign, then guess what? Your program was doing assignments, and you never knew it. If that's the case, then you were silently running a buggy program all along.
But even if you get no such error, keep that definition in the Queue class.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|