Frage im Vorstellungsgespräch bei Bloomberg

how does a reference counting smart pointger work?

Antwort im Vorstellungsgespräch

Anonym

4. Jan. 2010

I remeber the smart pointer is a class with a pointer member which points to the actual object and a counter member to record how many pointers point to the object. If the number of the counter is 0, then call the destructor function to delete the object. This smart pointer is to provent dangle pointer.