QScopedArrayPointer Class | Qt 4.8 (original) (raw)

The QScopedArrayPointer class stores a pointer to a dynamically allocated array of objects, and deletes it upon destruction. More...

Note: All functions in this class are reentrant.

Public Functions

Detailed Description

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:

Member Function Documentation

QScopedArrayPointer::QScopedArrayPointer()

Constructs a QScopedArrayPointer instance.

QScopedArrayPointer::QScopedArrayPointer(D * p, QtPrivate::QScopedArrayEnsureSameType<T, D>::Type = 0)

T & QScopedArrayPointer::operator[](int _i_)

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().

const T & QScopedArrayPointer::operator[](int _i_) const

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().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.