Quote Originally Posted by mayabelle View Post
Yes, that was the goal. In what way is it not making copies (other than the segfault)?
I stated how your original code may not work. You test original.first_ for NULL, and then you assumed that you must set your object's last_ to NULL along with size being 0. Then you return from the constructor.

What if original.first_ was NULL, but original.last_ wasn't NULL, or original.size_ was not 0? What would happen? Your code would have erroneously created an object that isn't a copy of the original.

Regards,

Paul McKenzie