QScopedArrayPointer Class
template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T>> class QScopedArrayPointerQScopedArrayPointer 클래스는 동적으로 할당된 객체 배열에 대한 포인터를 저장하고 소멸 시 이를 삭제합니다. 더 보기...
Header: | #include <QScopedArrayPointer> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
상속합니다: | QScopedPointer |
참고: 이 클래스의 모든 함수는 재진입합니다.
공용 함수
QScopedArrayPointer() | |
QScopedArrayPointer(D *p) | |
T & | operator[](qsizetype i) |
const T & | operator[](qsizetype i) const |
상세 설명
QScopedArray포인터는 기본적으로 삭제[] 연산자로 가리키고 있는 객체를 삭제하는 QScopedPointer 입니다. 또한 편의를 위해 연산자[] 기능을 제공하므로 쓸 수 있습니다:
void foo() { QScopedArrayPointer<int> i(new int[10]); i[2] = 42; ... return; // our integer array is now deleted using delete[] }
멤버 함수 문서
QScopedArrayPointer::QScopedArrayPointer()
QScopedArrayPointer 인스턴스를 생성합니다.
[explicit]
template <typename D, QScopedArrayPointer<T, Cleanup>::if_same_type<D> = true> QScopedArrayPointer::QScopedArrayPointer(D *p)
QScopedArrayPointer를 생성하고 p 이 가리키는 오브젝트 배열을 저장합니다.
T &QScopedArrayPointer::operator[](qsizetype i)
범위가 지정된 포인터의 객체 배열 중 i 항목에 대한 액세스를 제공합니다.
포함된 포인터가 nullptr
인 경우 동작이 정의되지 않습니다.
참고: 6.5 이전 Qt 버전에서 i 는 qsizetype
가 아닌 int
유형이었으므로 64비트 플랫폼에서 잘릴 수 있습니다.
isNull()도 참조하세요 .
const T &QScopedArrayPointer::operator[](qsizetype i) const
범위가 지정된 포인터의 객체 배열의 i 항목에 대한 액세스를 제공합니다.
포함된 포인터가 nullptr
인 경우 동작이 정의되지 않습니다.
참고: 6.5 이전 Qt 버전에서 i 는 qsizetype
가 아닌 int
유형이었으므로 64비트 플랫폼에서 잘릴 수 있습니다.
isNull()도 참조하세요 .
© 2025 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.