The QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction. More...
| Header: | #include <QScopedArrayPointer> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core)target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| Inherits: | QScopedPointer |
Note: All functions in this class are reentrant.
| QScopedArrayPointer() | |
| QScopedArrayPointer(D *p) | |
| T & | operator[](qsizetype i) |
| const T & | operator[](qsizetype i) const |
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 a QScopedArrayPointer instance.
[explicit] template <typename D, QScopedArrayPointer<T, Cleanup>::if_same_type<D> = true>
QScopedArrayPointer::QScopedArrayPointer(D *p)Constructs a QScopedArrayPointer and stores the array of objects pointed to by p.
Provides access to entry i of the scoped pointer's array of objects.
If the contained pointer is nullptr, behavior is undefined.
Note: In Qt versions prior to 6.5, i was of type int, not qsizetype, possibly causing truncation on 64-bit platforms.
See also isNull().
Provides access to entry i of the scoped pointer's array of objects.
If the contained pointer is nullptr behavior is undefined.
Note: In Qt versions prior to 6.5, i was of type int, not qsizetype, possibly causing truncation on 64-bit platforms.
See also isNull().
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: