Goldman Sachs Interview Question
Software Engineer / DevelopersI have a question about this, which I've also noticed in other smart-pointer implementation examples.
I guess I don't understand the usage, because it seems this code, in the assignment operator implementation:
ptr = smartPtr.ptr;
refCount = smartPtr.refCount;
inadvertently leak ptr and refCount in the lhs instance if it's already set up before the assignment?
- m@}{ April 18, 2011