PDA

View Full Version : smart pointers in Qt and Boost



pospiech
18th April 2010, 15:24
I am currently reading myself into the topic of smart pointers. I am currently not using boost in any project and would therefore add a dependancy to boost when I use their smart pointers. Therefore I try to understand the differences to the Qt smart pointers. I have mainly read http://labs.trolltech.com/blogs/2009/08/25/count-with-me-how-many-smart-pointer-classes-does-qt-have/ and the docs of the pointers.

Now I would like to know for sure if these ones are compatible in usage:

scoped_ptr <-> QScopedPointer
shared_ptr <-> QSharedPointer

for scoped_array and shared_array I could not find any companion in the Qt classes. Or can is tell the destructure to use "delete []" anyhow?

The QSharedDataPointer does not have any equivalent in boost, does it?

Matthias