QScopedArrayPointer Class ReferenceThe QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction. More... #include <QScopedArrayPointer> Inherits: QScopedPointer<T, Cleanup>. Note: All functions in this class are reentrant. This class was introduced in Qt 4.6. Public Functions
Detailed DescriptionThe QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction. A QScopedArrayPointer is a QScopedPointer that defaults to deleting the object it is pointing to with the delete[] operator. It also features operator[] for convenience, so we can write: void foo() { QScopedArrayPointer<int> i(new int[10]); i[2] = 42; ... return; // our integer array is now deleted using delete[] } Member Function Documentation
|