亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qvector.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtCore module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qvector.h"#include "qtools_p.h"#include <string.h>QVectorData QVectorData::shared_null = { Q_ATOMIC_INIT(1), 0, 0, true };QVectorData* QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData* init){    QVectorData* p = (QVectorData *)qMalloc(sizeofTypedData + (size - 1) * sizeofT);    ::memcpy(p, init, sizeofTypedData + (qMin(size, init->alloc) - 1) * sizeofT);    return p;}int QVectorData::grow(int sizeofTypedData, int size, int sizeofT, bool excessive){    if (excessive)        return size + size / 2;    return qAllocMore(size * sizeofT, sizeofTypedData - sizeofT) / sizeofT;}/*!     \class QVector    \brief The QVector class is a template class that provides a dynamic array.    \ingroup tools    \ingroup shared    \mainclass    \reentrant    QVector\<T\> is one of Qt's generic \l{container classes}. It    stores its items in adjacent memory locations and provides fast    index-based access.    QList\<T\>, QLinkedList\<T\>, and QVarLengthArray\<T\> provide    similar functionality. Here's an overview:    \list    \i For most purposes, QList is the right class to use. Operations       like prepend() and insert() are usually faster than with       QVector because of the way QList stores its items in memory       (see \l{Algorithmic Complexity} for details),       and its index-based API is more convenient than QLinkedList's       iterator-based API. It also expands to less code in your       executable.    \i If you need a real linked list, with guarantees of \l{constant       time} insertions in the middle of the list and iterators to       items rather than indexes, use QLinkedList.    \i If you want the items to occupy adjacent memory positions,       use QVector.    \i If you want a low-level variable-size array, QVarLengthArray    may be sufficient.    \endlist    Here's an example of a QVector that stores integers and a QVector    that stores QString values:    \code        QVector<int> integerVector;        QVector<QString> stringVector;    \endcode    QVector stores a vector (or array) of items. Typically, vectors    are created with an initial size. For example, the following code    constructs a QVector with 200 elements:    \code        QVector<QString> vector(200);    \endcode    The elements are automatically initialized with a    \l{default-constructed value}. If you want to initialize the    vector with a different value, pass that value as the second    argument to the constructor:    \code        QVector<QString> vector(200, "Pass");    \endcode    You can also call fill() at any time to fill the vector with a    value.    QVector uses 0-based indexes, just like C++ arrays. To access the    item at a particular index position, you can use operator[](). On    non-const vectors, operator[]() returns a reference to the item    that can be used on the left side of an assignment:    \code        if (vector[0] == "Liz")            vector[0] = "Elizabeth";    \endcode    For read-only access, an alternative syntax is to use at():    \code        for (int i = 0; i < vector.size(); ++i) {            if (vector.at(i) == "Alfonso")                cout << "Found Alfonso at position " << i << endl;        }    \endcode    at() can be faster than operator[](), because it never causes a    \l{deep copy} to occur.    Another way to access the data stored in a QVector is to call    data(). The function returns a pointer to the first item in the    vector. You can use the pointer to directly access and modify the    elements stored in the vector. The pointer is also useful if you    need to pass a QVector to a function that accepts a plain C++    array.    If you want to find all occurrences of a particular value in a    vector, use indexOf() or lastIndexOf(). The former searches    forward starting from a given index position, the latter searches    backward. Both return the index of the matching item if they found    one; otherwise, they return -1. For example:    \code        int i = vector.indexOf("Harumi");        if (i != -1)            cout << "First occurrence of Harumi is at position " << i << endl;    \endcode    If you simply want to check whether a vector contains a    particular value, use contains(). If you want to find out how    many times a particular value occurs in the vector, use count().    QVector provides these basic functions to add, move, and remove    items: insert(), replace(), remove(), prepend(), append(). With    the exception of append(), these functions can be slow (\l{linear    time}) for large vectors, because they require moving many items    in the vector by one position in memory. If you want a container    class that provides fast insertion/removal in the middle, use    QList or QLinkedList instead.    Unlike plain C++ arrays, QVectors can be resized at any time by    calling resize(). If the new size is larger than the old size,    QVector might need to reallocate the whole vector. QVector tries    to reduce the number of reallocations by preallocating up to twice    as much memory as the actual data needs.    If you know in advance approximately how many items the QVector    will contain, you can call reserve(), asking QVector to    preallocate a certain amount of memory. You can also call    capacity() to find out how much memory QVector actually    allocated.    QVector's value type must be an \l{assignable data type}. This    covers most data types that are commonly used, but the compiler    won't let you, for example, store a QWidget as a value; instead,    store a QWidget *. A few functions have additional requirements;    for example, indexOf() and lastIndexOf() expect the value type to    support \c operator==(). These requirements are documented on a    per-function basis.    Like the other container classes, QVector provides \l{Java-style    iterators} (QVectorIterator and QMutableVectorIterator) and    \l{STL-style iterators} (QVector::const_iterator and    QVector::iterator). In practice, these are rarely used, because    you can use indexes into the QVector.    In addition to QVector, Qt also provides QVarLengthArray, a very    low-level class with little functionality that is optimized for    speed.    QVector does \e not support inserting, prepending, appending or replacing    with references to its own values. Doing so will cause your application to    abort with an error message.    \sa QVectorIterator, QMutableVectorIterator, QList, QLinkedList*//*!    \fn QVector<T> QVector::mid(int pos, int length = -1) const    Returns a vector whose elements are copied from this vector,    starting at position \a pos. If \a length is -1 (the default), all    elements after \a pos are copied; otherwise \a length elements (or    all remaining elements if there are less than \a length elements)    are copied.*//*! \fn QVector::QVector()    Constructs an empty vector.    \sa resize()*//*! \fn QVector::QVector(int size)    Constructs a vector with an initial size of \a size elements.    The elements are initialized with a \l{default-constructed    value}.    \sa resize()*//*! \fn QVector::QVector(int size, const T &value)    Constructs a vector with an initial size of \a size elements.    Each element is initialized with \a value.    \sa resize(), fill()*//*! \fn QVector::QVector(const QVector<T> &other)    Constructs a copy of \a other.    This operation takes \l{constant time}, because QVector is    \l{implicitly shared}. This makes returning a QVector from a    function very fast. If a shared instance is modified, it will be    copied (copy-on-write), and that takes \l{linear time}.    \sa operator=()*//*! \fn QVector::~QVector()    Destroys the vector.*//*! \fn QVector<T> &QVector::operator=(const QVector<T> &other)    Assigns \a other to this vector and returns a reference to this    vector.*//*! \fn bool QVector::operator==(const QVector<T> &other) const    Returns true if \a other is equal to this vector; otherwise    returns false.    Two vectors are considered equal if they contain the same values    in the same order.    This function requires the value type to have an implementation    of \c operator==().    \sa operator!=()*//*! \fn bool QVector::operator!=(const QVector<T> &other) const    Returns true if \a other is not equal to this vector; otherwise    returns false.    Two vectors are considered equal if they contain the same values    in the same order.    This function requires the value type to have an implementation    of \c operator==().    \sa operator==()*//*! \fn int QVector::size() const    Returns the number of items in the vector.    \sa isEmpty(), resize()*//*! \fn bool QVector::isEmpty() const    Returns true if the vector has size 0; otherwise returns false.    \sa size(), resize()*//*! \fn void QVector::resize(int size)    Sets the size of the vector to \a size. If \a size is greater than the    current size, elements are added to the end; the new elements are    initialized with a \l{default-constructed value}. If \a size is less    than the current size, elements are removed from the end.    \sa size()*//*! \fn int QVector::capacity() const    Returns the maximum number of items that can be stored in the    vector without forcing a reallocation.    The sole purpose of this function is to provide a means of fine    tuning QVector's memory usage. In general, you will rarely ever    need to call this function. If you want to know how many items are    in the vector, call size().    \sa reserve(), squeeze()*//*! \fn void QVector::reserve(int size)    Attempts to allocate memory for at least \a size elements. If you    know in advance how large the vector will be, you can call this    function, and if you call resize() often you are likely to get    better performance. If \a size is an underestimate, the worst    that will happen is that the QVector will be a bit slower.    The sole purpose of this function is to provide a means of fine    tuning QVector's memory usage. In general, you will rarely ever    need to call this function. If you want to change the size of the    vector, call resize().    \sa squeeze(), capacity()*//*! \fn void QVector::squeeze()    Releases any memory not required to store the items.    The sole purpose of this function is to provide a means of fine    tuning QVector's memory usage. In general, you will rarely ever    need to call this function.    \sa reserve(), capacity()*//*! \fn void QVector::detach()    \internal*//*! \fn bool QVector::isDetached() const    \internal*//*! \fn void QVector::setSharable(bool sharable)    \internal*//*! \fn T *QVector::data()    Returns a pointer to the data stored in the vector. The pointer    can be used to access and modify the items in the vector.    Example:    \code        QVector<int> vector(10);        int *data = vector.data();        for (int i = 0; i < 10; ++i)            data[i] = 2 * i;    \endcode    The pointer remains valid as long as the vector isn't    reallocated.    This function is mostly useful to pass a vector to a function    that accepts a plain C++ array.    \sa constData(), operator[]()*//*! \fn const T *QVector::data() const    \overload*//*! \fn const T *QVector::constData() const    Returns a const pointer to the data stored in the vector. The    pointer can be used to access the items in the vector.    The pointer remains valid as long as the vector isn't    reallocated.    This function is mostly useful to pass a vector to a function    that accepts a plain C++ array.    \sa data(), operator[]()*//*! \fn void QVector::clear()    Removes all the elements from the vector.    Same as resize(0).*//*! \fn const T &QVector::at(int i) const    Returns the item at index position \a i in the vector.    \a i must be a valid index position in the vector (i.e., 0 <= \a    i < size()).    \sa value(), operator[]()*//*! \fn T &QVector::operator[](int i)    Returns the item at index position \a i as a modifiable reference.    \a i must be a valid index position in the vector (i.e., 0 <= \a i    < size()).    \sa at(), value()*//*! \fn const T &QVector::operator[](int i) const    \overload    Same as at(\a i).*//*! \fn void QVector::append(const T &value)    Inserts \a value at the end of the vector.    Example:    \code        QVector<QString> vector(0);        vector.append("one");        vector.append("two");        vector.append("three");        // vector: ["one", "two", three"]    \endcode    This is the same as calling resize(size() + 1) and assigning \a    value to the new last element in the vector.    This operation is relatively fast, because QVector typically    allocates more memory than necessary, so it can grow without    reallocating the entire vector each time.    \sa operator<<(), prepend(), insert()*//*! \fn void QVector::prepend(const T &value)    Inserts \a value at the beginning of the vector.    Example:    \code        QVector<QString> vector;        vector.prepend("one");        vector.prepend("two");        vector.prepend("three");        // vector: ["three", "two", "one"]    \endcode    This is the same as vector.insert(0, \a value).    For large vectors, this operation can be slow (\l{linear time}),    because it requires moving all the items in the vector by one    position further in memory. If you want a container class that    provides a fast prepend() function, use QList or QLinkedList    instead.    \sa append(), insert()*//*! \fn void QVector::insert(int i, const T &value)    Inserts \a value at index position \a i in the vector. If \a i is    0, the value is prepended to the vector. If \a i is size(), the    value is appended to the vector.    Example:    \code        QVector<QString> vector;        vector << "alpha" << "beta" << "delta";        vector.insert(2, "gamma");        // vector: ["alpha", "beta", "gamma", "delta"]    \endcode    For large vectors, this operation can be slow (\l{linear time}),    because it requires moving all the items at indexes \a i and    above by one position further in memory. If you want a container    class that provides a fast insert() function, use QLinkedList    instead.    \sa append(), prepend(), remove()*//*! \fn void QVector::insert(int i, int count, const T &value)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区四区不卡| 国产乱妇无码大片在线观看| 极品瑜伽女神91| 97久久超碰国产精品电影| 欧美三级日韩三级| 亚洲欧洲一区二区三区| 国内精品免费**视频| 欧美日韩在线播放一区| 国产精品家庭影院| 国产乱码精品一区二区三区五月婷| 欧美三级视频在线播放| 亚洲私人黄色宅男| 国产mv日韩mv欧美| 久久嫩草精品久久久精品一| 日本va欧美va精品发布| 欧美性猛交xxxx黑人交| 一区二区三区在线免费| 91丨九色丨蝌蚪丨老版| 国产精品美女久久久久久久久久久 | 激情综合一区二区三区| 欧美日韩成人在线| 一区二区三区在线免费观看 | 一本久久精品一区二区| 日本一区二区综合亚洲| 狠狠色丁香婷婷综合久久片| 欧美不卡激情三级在线观看| 狂野欧美性猛交blacked| 欧美顶级少妇做爰| 日本成人在线网站| 欧美精品xxxxbbbb| 视频在线在亚洲| 欧美一级精品在线| 久久精品国产一区二区三区免费看 | 91免费版在线看| 亚洲色图在线播放| 欧洲一区在线电影| 亚洲成人你懂的| 欧美日韩午夜影院| 免费观看日韩av| 26uuu国产在线精品一区二区| 久久99国产乱子伦精品免费| 欧美成人精品高清在线播放 | 免费在线观看成人| 欧美一级欧美三级| 精品一二三四区| 欧美国产日韩a欧美在线观看| 粉嫩13p一区二区三区| 成人免费小视频| 91激情五月电影| 天堂久久久久va久久久久| 日韩欧美成人一区| 成人免费高清视频| 亚洲国产精品欧美一二99| 91麻豆精品国产自产在线观看一区 | 国精产品一区一区三区mba视频| 精品av综合导航| 成人av电影在线观看| 亚洲一二三四久久| 欧美成人video| av在线这里只有精品| 亚洲影院理伦片| 欧美va天堂va视频va在线| jlzzjlzz欧美大全| 日韩二区在线观看| 久久影院午夜论| 色综合久久久久综合体桃花网| 水野朝阳av一区二区三区| 久久久精品国产免费观看同学| 91老师国产黑色丝袜在线| 五月综合激情婷婷六月色窝| 国产亚洲精品aa| 欧美婷婷六月丁香综合色| 国产一区二区美女诱惑| 夜夜嗨av一区二区三区网页| 久久综合丝袜日本网| 欧美日韩在线播放一区| 成人黄页在线观看| 日韩高清不卡在线| 亚洲欧美日韩中文字幕一区二区三区 | 国产真实乱对白精彩久久| 亚洲欧美一区二区不卡| 久久综合精品国产一区二区三区| 91麻豆免费看| 国产福利不卡视频| 免费亚洲电影在线| 午夜久久福利影院| 亚洲欧美日韩久久| 国产欧美一区二区精品性色| 91精品久久久久久久91蜜桃| 色拍拍在线精品视频8848| 成人中文字幕电影| 国产在线精品免费| 美美哒免费高清在线观看视频一区二区 | 精品视频在线看| 成人丝袜高跟foot| 国产在线精品一区二区夜色| 婷婷国产在线综合| 亚洲免费资源在线播放| 欧美韩国一区二区| 26uuu国产电影一区二区| 日韩欧美久久久| 欧美精品视频www在线观看| 色婷婷狠狠综合| 色婷婷狠狠综合| 色综合久久88色综合天天| 国产91精品久久久久久久网曝门| 精品一区二区三区不卡| 老司机精品视频在线| 奇米影视7777精品一区二区| 天堂成人免费av电影一区| 日韩二区在线观看| 日韩一区精品视频| 美日韩一区二区三区| 免费成人在线观看视频| 久久99热这里只有精品| 日本aⅴ免费视频一区二区三区 | 亚洲乱码国产乱码精品精可以看| 欧美激情综合五月色丁香小说| 久久精品亚洲精品国产欧美kt∨| 久久青草欧美一区二区三区| 久久久精品人体av艺术| 国产欧美日韩一区二区三区在线观看| 国产婷婷色一区二区三区四区 | 成人精品国产福利| www.色精品| 欧美视频一区二区三区四区 | 欧美精品乱码久久久久久按摩| 欧美午夜不卡在线观看免费| 欧美老肥妇做.爰bbww视频| 777亚洲妇女| 久久午夜色播影院免费高清 | 午夜久久电影网| 午夜欧美2019年伦理| 久久av中文字幕片| 国产高清一区日本| 91最新地址在线播放| 欧美日韩一区中文字幕| 久久综合色播五月| 亚洲人成人一区二区在线观看| 亚洲午夜电影网| 极品销魂美女一区二区三区| 99精品国产视频| 欧美一卡二卡在线| 国产精品乱人伦中文| 午夜成人免费视频| 国产91丝袜在线播放九色| 欧亚一区二区三区| 精品久久久久久综合日本欧美| 国产精品乱人伦| 日本不卡的三区四区五区| 国产精品911| 欧美无人高清视频在线观看| 精品国产乱码久久久久久闺蜜| 亚洲国产精品成人综合| 午夜激情久久久| 国产91富婆露脸刺激对白| 欧美日韩国产首页在线观看| 久久综合久久综合久久综合| 亚洲国产综合91精品麻豆| 国产麻豆视频一区| 欧美日韩一区视频| **欧美大码日韩| 国产综合成人久久大片91| 欧美日韩在线电影| 国产精品欧美一级免费| 玖玖九九国产精品| 欧美亚洲动漫制服丝袜| 国产精品欧美一区喷水| 国产一区在线观看视频| 欧美日韩国产片| 亚洲人成人一区二区在线观看 | 国产麻豆精品一区二区| 欧美日韩精品一区二区三区四区 | 亚洲精品中文在线| 国产高清在线精品| 日韩精品最新网址| 亚洲成人高清在线| 99精品黄色片免费大全| 欧美国产精品一区二区| 久久精品久久精品| 欧美一区二区三区在| 亚瑟在线精品视频| 日本精品视频一区二区三区| 国产精品污网站| 国产99久久久国产精品| 久久久亚洲精品石原莉奈| 久久国产夜色精品鲁鲁99| 91精品国产综合久久久久久久 | 亚洲欧美另类久久久精品| 国产·精品毛片| 久久久久国产精品免费免费搜索| 麻豆国产一区二区| 精品三级av在线| 精品一区二区三区视频| 精品少妇一区二区三区免费观看| 全国精品久久少妇| 欧美成人官网二区| 国产乱码精品1区2区3区| 久久精品亚洲一区二区三区浴池| 国产精品自拍一区|