4 ms·
This is C++. Implement your own deconstructor, and manage your own damn memory. I would probably use Boost's smart pointers to handle the reference counting t
by mrtron 17y ago
This is C++. Implement your own deconstructor, and manage your own damn memory.
I would probably use Boost's smart pointers to handle the reference counting though.
- swolchok 17y agoNo, GP's point is that there are garbage collectors for C++. I believe Stroustrup even mentions one in The C++ Programming Kanguage. Furthermore, you CAN tell the type of an object given a pointer to it, assuming it has at least one virtual function, using the typeid operator. As the GP said, the original quote is nonsense.
- calambrac 17y agoassuming it has at least one virtual function Which you can't do. Seriously, when did it become okay to call out a problem with the general case as nonsense because there's a specific case that avoids the issue?