QtBase
v6.3.1
|
The QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction. More...
#include <qscopedpointer.h>
Public Member Functions | |
QScopedArrayPointer () | |
~QScopedArrayPointer ()=default | |
template<typename D , if_same_type< D > = true> | |
QScopedArrayPointer (D *p) | |
T & | operator[] (int i) |
const T & | operator[] (int i) const |
Public Member Functions inherited from QScopedPointer< T, QScopedPointerArrayDeleter< T > > | |
QScopedPointer (T *p=nullptr) noexcept | |
~QScopedPointer () | |
T & | operator* () const |
T * | operator-> () const noexcept |
bool | operator! () const noexcept |
operator bool () const | |
T * | data () const noexcept |
T * | get () const noexcept |
bool | isNull () const noexcept |
void | reset (T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >()))) |
Additional Inherited Members | |
Public Types inherited from QScopedPointer< T, QScopedPointerArrayDeleter< T > > | |
typedef T * | pointer |
Protected Attributes inherited from QScopedPointer< T, QScopedPointerArrayDeleter< T > > | |
T * | d |
The QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction.
\inmodule QtCore
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:
Definition at line 226 of file qscopedpointer.h.
|
inline |
Constructs a QScopedArrayPointer instance.
Definition at line 231 of file qscopedpointer.h.
|
inlinedefault |
|
inlineexplicit |
Constructs a QScopedArrayPointer and stores the array of objects pointed to by p.
Definition at line 235 of file qscopedpointer.h.
|
inline |
Provides access to entry i of the scoped pointer's array of objects.
If the contained pointer is \nullptr, behavior is undefined.
Definition at line 240 of file qscopedpointer.h.
|
inline |
Provides access to entry i of the scoped pointer's array of objects.
If the contained pointer is \nullptr behavior is undefined.
Definition at line 245 of file qscopedpointer.h.