src/corelib/tools/qscopedpointer.cpp
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtCore module of the Qt Toolkit.
     7 ** This file is part of the QtCore module of the Qt Toolkit.
     8 **
     8 **
   223 
   223 
   224 /*! \fn void QScopedPointer::swap(QScopedPointer<T, Cleanup> &other)
   224 /*! \fn void QScopedPointer::swap(QScopedPointer<T, Cleanup> &other)
   225   Swap this pointer with \a other.
   225   Swap this pointer with \a other.
   226  */
   226  */
   227 
   227 
       
   228 /*!
       
   229   \class QScopedArrayPointer
       
   230   
       
   231   \brief The QScopedArrayPointer class stores a pointer to a
       
   232   dynamically allocated array of objects, and deletes it upon
       
   233   destruction.
       
   234 
       
   235   \since 4.6
       
   236   \reentrant
       
   237   \ingroup misc
       
   238 
       
   239   A QScopedArrayPointer is a QScopedPointer that defaults to
       
   240   deleting the object it is pointing to with the delete[] operator. It
       
   241   also features operator[] for convenience, so we can write:
       
   242 
       
   243   \code
       
   244     void foo()
       
   245     {
       
   246         QScopedArrayPointer<int> i(new int[10]);
       
   247         i[2] = 42;
       
   248         ...
       
   249         return; // our integer array is now deleted using delete[]
       
   250     }
       
   251   \endcode
       
   252 */
       
   253 
       
   254 /*!
       
   255     \fn QScopedArrayPointer::QScopedArrayPointer(T *p = 0)
       
   256 
       
   257     Constructs this QScopedArrayPointer instance and sets its pointer
       
   258     to \a p.
       
   259 */
       
   260 
       
   261 /*!
       
   262     \fn T *QScopedArrayPointer::operator[](int i)
       
   263 
       
   264     Provides access to entry \a i of the scoped pointer's array of
       
   265     objects.
       
   266 
       
   267     If the contained pointer is \c null, behavior is undefined.
       
   268 
       
   269     \sa isNull()
       
   270 */
       
   271 
       
   272 /*!
       
   273     \fn T *QScopedArrayPointer::operator[](int i) const
       
   274 
       
   275     Provides access to entry \a i of the scoped pointer's array of
       
   276     objects.
       
   277 
       
   278     If the contained pointer is \c null, behavior is undefined.
       
   279 
       
   280     \sa isNull()
       
   281 */
       
   282 
   228 QT_END_NAMESPACE
   283 QT_END_NAMESPACE