Linked by Thom Holwerda on Mon 24th Aug 2009 15:06 UTC, submitted by diegocg
Qt Qt usually takes the boring memory allocation and deallocation from you, either through its implicitly shared containers, or with QObject's parent child relationship model. But every once in a while, we need to allocate something on the heap, and then the stress starts - where do we delete it, and how do we make sure to not leak the memory? To fix this problem, QScopedPointer was born. It will delete the object it is pointing to automatically when it goes out of scope.
Permalink for comment 380602
To read all comments associated with this story, please click here.
WTF is this news?
by fernandotcl on Tue 25th Aug 2009 22:26 UTC
fernandotcl
Member since:
2007-08-12

WTF is this newsworthy? A scoped pointer is one of the most basic elements of RIIA-based C++ programming, any decent programmer knows how to implement it or use std::auto_ptr, boost::scoped_ptr or any of the 400 gazillion variations available EVERYWHERE.

No, I can't stress this enough, this is the most retarded piece of news I've seen here in a while.

Reply Score: 1