Re: Copy Constructors and Assignment Operator, When should I use?



"rockdale" wrote:
Yes, it will copy everything, provided that set items have
proper
copy constructor.

for the ItemSet class, I do not have any user defined copy
cctor, do I
need one?

If the `ItemSet' class is defined as in your other post, then you
don't need explicit cctor.

class ItemSet{

ItemListA a;
ItemListB b;
...
};

The `ItemSet' class doesn't need [user defined] cctor either
since all its
members know how to copy themselves.


Alex


.



Relevant Pages