The 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.
QScopedArrayPointer ( T * p = 0 ) | |
T & | operator[] ( int i ) |
const T & | operator[] ( int i ) const |
The 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[] }
Constructs this QScopedArrayPointer instance and sets its pointer to p.
Provides access to entry i of the scoped pointer's array of objects.
If the contained pointer is null, behavior is undefined.
See also isNull().
Provides access to entry i of the scoped pointer's array of objects.
If the contained pointer is null, behavior is undefined.
See also isNull().
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.