S
Soumen
If I've class with one of data members of auto_ptr type, how should I
write copy ctr or copy assignment operator if I don't intend to allow
transfer of ownership happen? Declaring that member const could be one
option I guess. Clarify me if this understanding is wrong. Do I need
to disable these (copy ctr and assignment operator) in such cases?
What happens when I don't write one and use the compiler generated
one? Does transfer of ownership still happens or it's same as
declaring member as const? Looks like disabling these two are best
design decision.
Regards,
~ Soumen
write copy ctr or copy assignment operator if I don't intend to allow
transfer of ownership happen? Declaring that member const could be one
option I guess. Clarify me if this understanding is wrong. Do I need
to disable these (copy ctr and assignment operator) in such cases?
What happens when I don't write one and use the compiler generated
one? Does transfer of ownership still happens or it's same as
declaring member as const? Looks like disabling these two are best
design decision.
Regards,
~ Soumen