⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qlinkedlist.cpp

📁 奇趣公司比较新的qt/emd版本
💻 CPP
📖 第 1 页 / 共 3 页
字号:
    Returns an iterator to the item at \a j positions forward from    this iterator. (If \a j is negative, the iterator goes backward.)    This operation can be slow for large \a j values.    \sa operator-()*//*! \fn QLinkedList::iterator QLinkedList::iterator::operator-(int j) const    Returns an iterator to the item at \a j positions backward from    this iterator. (If \a j is negative, the iterator goes forward.)    This operation can be slow for large \a j values.    \sa operator+()*//*! \fn QLinkedList::iterator &QLinkedList::iterator::operator+=(int j)    Advances the iterator by \a j items. (If \a j is negative, the    iterator goes backward.)    \sa operator-=(), operator+()*//*! \fn QLinkedList::iterator &QLinkedList::iterator::operator-=(int j)    Makes the iterator go back by \a j items. (If \a j is negative,    the iterator goes forward.)    \sa operator+=(), operator-()*//*! \class QLinkedList::const_iterator    \brief The QLinkedList::const_iterator class provides an STL-style const iterator for QLinkedList.    QLinkedList features both \l{STL-style iterators} and    \l{Java-style iterators}. The STL-style iterators are more    low-level and more cumbersome to use; on the other hand, they are    slightly faster and, for developers who already know STL, have    the advantage of familiarity.    QLinkedList\<T\>::const_iterator allows you to iterate over a    QLinkedList\<T\>. If you want modify the QLinkedList as you iterate    over it, you must use QLinkedList::const_iterator instead. It is    generally good practice to use QLinkedList::const_iterator on a    non-const QLinkedList as well, unless you need to change the    QLinkedList through the iterator. Const iterators are slightly    faster, and can improve code readability.    The default QLinkedList::const_iterator constructor creates an    uninitialized iterator. You must initialize it using a function    like QLinkedList::constBegin(), QLinkedList::constEnd(), or    QLinkedList::insert() before you can start iterating. Here's a    typical loop that prints all the items stored in a list:    \code        QLinkedList<QString> list;        list.append("January");        list.append("February");        ...        list.append("December");        QLinkedList<QString>::const_iterator i;        for (i = list.constBegin(); i != list.constEnd(); ++i)            cout << *i << endl;    \endcode    STL-style iterators can be used as arguments to \l{generic    algorithms}. For example, here's how to find an item in the list    using the qFind() algorithm:    \code        QLinkedList<QString> list;        ...        QLinkedList<QString>::iterator it = qFind(list.constBegin(),                                                  list.constEnd(), "Joel");        if (it != list.constEnd())            cout << "Found Joel" << endl;    \endcode    Multiple iterators can be used on the same list. If you add items    to the list, existing iterators will remain valid. If you remove    items from the list, iterators that point to the removed items    will become dangling iterators.    \sa QLinkedList::iterator, QLinkedListIterator*//*! \fn QLinkedList::const_iterator::const_iterator()    Constructs an uninitialized iterator.    Functions like operator*() and operator++() should not be called    on an uninitialized iterartor. Use operator=() to assign a value    to it before using it.    \sa QLinkedList::constBegin() QLinkedList::constEnd()*//*! \fn QLinkedList::const_iterator::const_iterator(Node *node)    \internal*//*! \typedef QLinkedList::const_iterator::iterator_category    \internal*//*! \typedef QLinkedList::const_iterator::difference_type    \internal*//*! \typedef QLinkedList::const_iterator::value_type    \internal*//*! \typedef QLinkedList::const_iterator::pointer    \internal*//*! \typedef QLinkedList::const_iterator::reference    \internal*//*! \fn QLinkedList::const_iterator::const_iterator(const const_iterator &other)    Constructs a copy of \a other.*//*! \fn QLinkedList::const_iterator::const_iterator(iterator other)    Constructs a copy of \a other.*//*! \fn QLinkedList::const_iterator &QLinkedList::const_iterator::operator=( \            const const_iterator &other)    Assigns \a other to this iterator.*//*! \fn const T &QLinkedList::const_iterator::operator*() const    Returns a reference to the current item.    \sa operator->()*//*! \fn const T *QLinkedList::const_iterator::operator->() const    Returns a pointer to the current item.    \sa operator*()*//*! \fn bool QLinkedList::const_iterator::operator==(const const_iterator &other) const    Returns true if \a other points to the same item as this    iterator; otherwise returns false.    \sa operator!=()*//*! \fn bool QLinkedList::const_iterator::operator!=(const const_iterator &other) const    Returns true if \a other points to a different item than this    iterator; otherwise returns false.    \sa operator==()*//*! \fn QLinkedList::const_iterator &QLinkedList::const_iterator::operator++()    The prefix ++ operator (\c{++it}) advances the iterator to the    next item in the list and returns an iterator to the new current    item.    Calling this function on QLinkedList::constEnd() leads to    undefined results.    \sa operator--()*//*! \fn QLinkedList::const_iterator QLinkedList::const_iterator::operator++(int)    \overload    The postfix ++ operator (\c{it++}) advances the iterator to the    next item in the list and returns an iterator to the previously    current item.*//*! \fn QLinkedList::const_iterator &QLinkedList::const_iterator::operator--()    The prefix -- operator (\c{--it}) makes the preceding item    current and returns an iterator to the new current item.    Calling this function on QLinkedList::begin() leads to undefined    results.    \sa operator++()*//*! \fn QLinkedList::const_iterator QLinkedList::const_iterator::operator--(int)    \overload    The postfix -- operator (\c{it--}) makes the preceding item    current and returns an iterator to the previously current item.*//*! \fn QLinkedList::const_iterator QLinkedList::const_iterator::operator+(int j) const    Returns an iterator to the item at \a j positions forward from    this iterator. (If \a j is negative, the iterator goes backward.)    This operation can be slow for large \a j values.    \sa operator-()*//*! \fn QLinkedList::const_iterator QLinkedList::const_iterator::operator-(int j) const    This function returns an iterator to the item at \a j positions backward from    this iterator. (If \a j is negative, the iterator goes forward.)    This operation can be slow for large \a j values.     \sa operator+()*//*! \fn QLinkedList::const_iterator &QLinkedList::const_iterator::operator+=(int j)    Advances the iterator by \a j items. (If \a j is negative, the    iterator goes backward.)    This operation can be slow for large \a j values.    \sa operator-=(), operator+()*//*! \fn QLinkedList::const_iterator &QLinkedList::const_iterator::operator-=(int j)    Makes the iterator go back by \a j items. (If \a j is negative,    the iterator goes forward.)    This operation can be slow for large \a j values.    \sa operator+=(), operator-()*//*! \fn QDataStream &operator<<(QDataStream &out, const QLinkedList<T> &list)    \relates QLinkedList    Writes the linked list \a list to stream \a out.    This function requires the value type to implement \c    operator<<().    \sa \link datastreamformat.html Format of the QDataStream operators \endlink*//*! \fn QDataStream &operator>>(QDataStream &in, QLinkedList<T> &list)    \relates QLinkedList    Reads a linked list from stream \a in into \a list.    This function requires the value type to implement \c operator>>().    \sa \link datastreamformat.html Format of the QDataStream operators \endlink*//*!    \fn iterator QLinkedList::remove(iterator pos)    Use erase() instead.*//*!    \fn int QLinkedList::findIndex(const T& t) const    If you need indexes then QList or QVector are better choices than    QLinkedList.    \oldcode    int index = list->findIndex(value);    \newcode    int index = 0;    bool found = false;    for (const_iterator i = list->begin(); i != list->end(); ++i; ++index)        if (*i == value) {            found = true;            break;        }    if (!found)        index = -1;    \endcode*//*!    \fn iterator QLinkedList::find(iterator from, const T& t)    If you need random access to a data structure then QList, QVector,    QMap, or QHash, are all better choices than QLinkedList.    \oldcode    QLinkedList::iterator i = list->find(from, value);    \newcode    QLinkedList::iterator i = from;    while (i != list->end() && *i != value)        ++i;    \endcode*//*!    \fn iterator QLinkedList::find(const T& t)    If you need random access to a data structure then QList, QVector,    QMap, or QHash, are all better choices than QLinkedList.    \oldcode    QLinkedList::iterator i = list->find(value);    \newcode    QLinkedList::iterator i = list->begin();    while (i != list->end() && *i != value)        ++i;    \endcode*//*!    \fn const_iterator QLinkedList::find(const_iterator from, const T& t) const    If you need random access to a data structure then QList, QVector,    QMap, or QHash, are all better choices than QLinkedList.    \oldcode    QLinkedList::const_iterator i = list->find(from, value);    \newcode    QLinkedList::const_iterator i = from;    while (i != list->end() && *i != value)        ++i;    \endcode*//*!    \fn const_iterator QLinkedList::find(const T& t) const    If you need random access to a data structure then QList, QVector,    QMap, or QHash, are all better choices than QLinkedList.    \oldcode    QLinkedList::const_iterator i = list->find(value);    \newcode    QLinkedList::const_iterator i = list->begin();    while (i != list->end() && *i != value)        ++i;    \endcode*//*!    \since 4.1    \fn QLinkedList<T> QLinkedList<T>::fromStdList(const std::list<T> &list)    Returns a QLinkedList object with the data contained in \a list.    The order of the elements in the QLinkedList is the same as in \a    list.    Example:    \code        std::list<double> stdlist;        list.push_back(1.2);        list.push_back(0.5);        list.push_back(3.14);        QLinkedList<double> list = QLinkedList<double>::fromStdList(stdlist);    \endcode    \sa toStdList()*//*!    \since 4.1    \fn std::list<T> QLinkedList<T>::toStdList() const    Returns a std::list object with the data contained in this    QLinkedList. Example:    \code        QLinkedList<double> list;        list << 1.2 << 0.5 << 3.14;        std::list<double> stdlist = list.toStdList();    \endcode    \sa fromStdList()*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -