Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qscopedpointer.h>
Public Member Functions | |
Q_NODISCARD_CTOR | QScopedArrayPointer () |
Constructs a QScopedArrayPointer instance. | |
~QScopedArrayPointer ()=default | |
template<typename D , if_same_type< D > = true> | |
Q_NODISCARD_CTOR | QScopedArrayPointer (D *p) |
Constructs a QScopedArrayPointer and stores the array of objects pointed to by p. | |
T & | operator[] (qsizetype i) |
Provides access to entry i of the scoped pointer's array of objects. | |
const T & | operator[] (qsizetype i) const |
Provides access to entry i of the scoped pointer's array of objects. | |
Public Member Functions inherited from QScopedPointer< T, Cleanup > | |
Q_NODISCARD_CTOR | QScopedPointer (T *p=nullptr) noexcept |
Constructs this QScopedPointer instance and sets its pointer to p. | |
~QScopedPointer () | |
Destroys this QScopedPointer object. | |
T & | operator* () const |
Provides access to the scoped pointer's object. | |
T * | operator-> () const noexcept |
Provides access to the scoped pointer's object. | |
bool | operator! () const noexcept |
Returns true if this object refers to \nullptr. | |
operator bool () const | |
Returns true if the contained pointer is not \nullptr. | |
T * | data () const noexcept |
Returns the value of the pointer referenced by this object. | |
T * | get () const noexcept |
bool | isNull () const noexcept |
Returns true if this object refers to \nullptr. | |
void | reset (T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >()))) |
Deletes the existing object it is pointing to (if any), and sets its pointer to other. | |
Additional Inherited Members | |
Public Types inherited from QScopedPointer< T, Cleanup > | |
typedef T * | pointer |
Protected Attributes inherited from QScopedPointer< T, Cleanup > | |
T * | d |
\inmodule QtCore
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:
Definition at line 191 of file qscopedpointer.h.
|
inline |
Constructs a QScopedArrayPointer instance.
Definition at line 197 of file qscopedpointer.h.
|
inlinedefault |
|
inlineexplicit |
Constructs a QScopedArrayPointer and stores the array of objects pointed to by p.
Definition at line 202 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.
{int}, not
{qsizetype}, possibly causing truncation on 64-bit platforms.Definition at line 207 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.
{int}, not
{qsizetype}, possibly causing truncation on 64-bit platforms.Definition at line 212 of file qscopedpointer.h.