Remove references to QT_NO_STL from QtCore

QT_NO_STL is now no longer defined, so remove the conditionals and
select the STL side.

Change-Id: Ieedd248ae16e5a128b4ac287f850b3ebc8fb6181
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
This commit is contained in:
Thiago Macieira 2012-03-26 15:28:40 -03:00 committed by Qt by Nokia
parent 1241a02a01
commit 6f51fee995
15 changed files with 5 additions and 89 deletions

View File

@ -69,9 +69,7 @@
#ifdef __cplusplus #ifdef __cplusplus
#ifndef QT_NO_STL
#include <algorithm> #include <algorithm>
#endif
#ifndef QT_NAMESPACE /* user namespace */ #ifndef QT_NAMESPACE /* user namespace */
@ -1183,14 +1181,8 @@ static inline bool qIsNull(float f)
template <typename T> template <typename T>
inline void qSwap(T &value1, T &value2) inline void qSwap(T &value1, T &value2)
{ {
#ifdef QT_NO_STL
const T t = value1;
value1 = value2;
value2 = t;
#else
using std::swap; using std::swap;
swap(value1, value2); swap(value1, value2);
#endif
} }
#if QT_DEPRECATED_SINCE(5, 0) #if QT_DEPRECATED_SINCE(5, 0)

View File

@ -172,9 +172,6 @@ Q_DECLARE_TYPEINFO_BODY(QFlags<T>, Q_PRIMITIVE_TYPE);
types must declare a 'bool isDetached(void) const;' member for this types must declare a 'bool isDetached(void) const;' member for this
to work. to work.
*/ */
#ifdef QT_NO_STL
#define Q_DECLARE_SHARED_STL(TYPE)
#else
#define Q_DECLARE_SHARED_STL(TYPE) \ #define Q_DECLARE_SHARED_STL(TYPE) \
QT_END_NAMESPACE \ QT_END_NAMESPACE \
namespace std { \ namespace std { \
@ -182,7 +179,6 @@ namespace std { \
{ swap(value1.data_ptr(), value2.data_ptr()); } \ { swap(value1.data_ptr(), value2.data_ptr()); } \
} \ } \
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#endif
#define Q_DECLARE_SHARED(TYPE) \ #define Q_DECLARE_SHARED(TYPE) \
template <> inline void qSwap<TYPE>(TYPE &value1, TYPE &value2) \ template <> inline void qSwap<TYPE>(TYPE &value1, TYPE &value2) \

View File

@ -45,10 +45,8 @@
#include <QtCore/qiterator.h> #include <QtCore/qiterator.h>
#include <QtCore/qrefcount.h> #include <QtCore/qrefcount.h>
#ifndef QT_NO_STL
#include <iterator> #include <iterator>
#include <list> #include <list>
#endif
QT_BEGIN_HEADER QT_BEGIN_HEADER
@ -221,12 +219,10 @@ public:
typedef const value_type &const_reference; typedef const value_type &const_reference;
typedef qptrdiff difference_type; typedef qptrdiff difference_type;
#ifndef QT_NO_STL
static inline QLinkedList<T> fromStdList(const std::list<T> &list) static inline QLinkedList<T> fromStdList(const std::list<T> &list)
{ QLinkedList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; } { QLinkedList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; }
inline std::list<T> toStdList() const inline std::list<T> toStdList() const
{ std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } { std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
#endif
// comfort // comfort
QLinkedList<T> &operator+=(const QLinkedList<T> &l); QLinkedList<T> &operator+=(const QLinkedList<T> &l);

View File

@ -46,12 +46,9 @@
#include <QtCore/qiterator.h> #include <QtCore/qiterator.h>
#include <QtCore/qrefcount.h> #include <QtCore/qrefcount.h>
#ifndef QT_NO_STL
#include <iterator> #include <iterator>
#include <list> #include <list>
#endif
#ifdef Q_COMPILER_INITIALIZER_LISTS #ifdef Q_COMPILER_INITIALIZER_LISTS
#include <iterator>
#include <initializer_list> #include <initializer_list>
#endif #endif
@ -333,12 +330,10 @@ public:
static QList<T> fromVector(const QVector<T> &vector); static QList<T> fromVector(const QVector<T> &vector);
static QList<T> fromSet(const QSet<T> &set); static QList<T> fromSet(const QSet<T> &set);
#ifndef QT_NO_STL
static inline QList<T> fromStdList(const std::list<T> &list) static inline QList<T> fromStdList(const std::list<T> &list)
{ QList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; } { QList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; }
inline std::list<T> toStdList() const inline std::list<T> toStdList() const
{ std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } { std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
#endif
private: private:
Node *detach_helper_grow(int i, int n); Node *detach_helper_grow(int i, int n);

View File

@ -51,10 +51,7 @@
#include <QtCore/qdebug.h> #include <QtCore/qdebug.h>
#endif #endif
#ifndef QT_NO_STL
#include <map> #include <map>
#endif
#include <new> #include <new>
QT_BEGIN_HEADER QT_BEGIN_HEADER
@ -349,10 +346,8 @@ public:
{ qSwap(d, other.d); return *this; } { qSwap(d, other.d); return *this; }
#endif #endif
inline void swap(QMap<Key, T> &other) { qSwap(d, other.d); } inline void swap(QMap<Key, T> &other) { qSwap(d, other.d); }
#ifndef QT_NO_STL
explicit QMap(const typename std::map<Key, T> &other); explicit QMap(const typename std::map<Key, T> &other);
std::map<Key, T> toStdMap() const; std::map<Key, T> toStdMap() const;
#endif
bool operator==(const QMap<Key, T> &other) const; bool operator==(const QMap<Key, T> &other) const;
inline bool operator!=(const QMap<Key, T> &other) const { return !(*this == other); } inline bool operator!=(const QMap<Key, T> &other) const { return !(*this == other); }
@ -939,7 +934,6 @@ Q_OUTOFLINE_TEMPLATE bool QMap<Key, T>::operator==(const QMap<Key, T> &other) co
return true; return true;
} }
#ifndef QT_NO_STL
template <class Key, class T> template <class Key, class T>
Q_OUTOFLINE_TEMPLATE QMap<Key, T>::QMap(const std::map<Key, T> &other) Q_OUTOFLINE_TEMPLATE QMap<Key, T>::QMap(const std::map<Key, T> &other)
{ {
@ -963,8 +957,6 @@ Q_OUTOFLINE_TEMPLATE std::map<Key, T> QMap<Key, T>::toStdMap() const
return map; return map;
} }
#endif // QT_NO_STL
template <class Key, class T> template <class Key, class T>
class QMultiMap : public QMap<Key, T> class QMultiMap : public QMap<Key, T>
{ {

View File

@ -185,7 +185,6 @@ template <class T, class Cleanup>
Q_INLINE_TEMPLATE void qSwap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) Q_INLINE_TEMPLATE void qSwap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2)
{ p1.swap(p2); } { p1.swap(p2); }
#ifndef QT_NO_STL
QT_END_NAMESPACE QT_END_NAMESPACE
namespace std { namespace std {
template <class T, class Cleanup> template <class T, class Cleanup>
@ -193,7 +192,6 @@ namespace std {
{ p1.swap(p2); } { p1.swap(p2); }
} }
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#endif

View File

@ -264,7 +264,6 @@ template <class T>
Q_INLINE_TEMPLATE void qSwap(QExplicitlySharedDataPointer<T> &p1, QExplicitlySharedDataPointer<T> &p2) Q_INLINE_TEMPLATE void qSwap(QExplicitlySharedDataPointer<T> &p1, QExplicitlySharedDataPointer<T> &p2)
{ p1.swap(p2); } { p1.swap(p2); }
#ifndef QT_NO_STL
QT_END_NAMESPACE QT_END_NAMESPACE
namespace std { namespace std {
template <class T> template <class T>
@ -276,7 +275,6 @@ namespace std {
{ p1.swap(p2); } { p1.swap(p2); }
} }
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#endif
template<typename T> Q_DECLARE_TYPEINFO_BODY(QSharedDataPointer<T>, Q_MOVABLE_TYPE); template<typename T> Q_DECLARE_TYPEINFO_BODY(QSharedDataPointer<T>, Q_MOVABLE_TYPE);
template<typename T> Q_DECLARE_TYPEINFO_BODY(QExplicitlySharedDataPointer<T>, Q_MOVABLE_TYPE); template<typename T> Q_DECLARE_TYPEINFO_BODY(QExplicitlySharedDataPointer<T>, Q_MOVABLE_TYPE);

View File

@ -791,7 +791,6 @@ inline void qSwap(QSharedPointer<T> &p1, QSharedPointer<T> &p2)
p1.swap(p2); p1.swap(p2);
} }
#ifndef QT_NO_STL
QT_END_NAMESPACE QT_END_NAMESPACE
namespace std { namespace std {
template <class T> template <class T>
@ -799,7 +798,6 @@ namespace std {
{ p1.swap(p2); } { p1.swap(p2); }
} }
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#endif
namespace QtSharedPointer { namespace QtSharedPointer {
// helper functions: // helper functions:

View File

@ -944,9 +944,6 @@ const QStaticStringData<1> QString::shared_empty = { Q_STATIC_STRING_DATA_HEADER
windows) and ucs4 if the size of wchar_t is 4 bytes (most Unix windows) and ucs4 if the size of wchar_t is 4 bytes (most Unix
systems). systems).
This method is only available if Qt is configured with STL
compatibility enabled and if QT_NO_STL is not defined.
\sa fromUtf16(), fromLatin1(), fromLocal8Bit(), fromUtf8(), fromUcs4() \sa fromUtf16(), fromLatin1(), fromLocal8Bit(), fromUtf8(), fromUcs4()
*/ */
@ -972,9 +969,6 @@ const QStaticStringData<1> QString::shared_empty = { Q_STATIC_STRING_DATA_HEADER
This operator is mostly useful to pass a QString to a function This operator is mostly useful to pass a QString to a function
that accepts a std::wstring object. that accepts a std::wstring object.
This operator is only available if Qt is configured with STL
compatibility enabled and if QT_NO_STL is not defined.
\sa utf16(), toAscii(), toLatin1(), toUtf8(), toLocal8Bit() \sa utf16(), toAscii(), toLatin1(), toUtf8(), toLocal8Bit()
*/ */
@ -7399,9 +7393,6 @@ bool QString::isRightToLeft() const
If the QString contains non-Latin1 Unicode characters, using this If the QString contains non-Latin1 Unicode characters, using this
can lead to loss of information. can lead to loss of information.
This operator is only available if Qt is configured with STL
compatibility enabled and if QT_NO_STL is not defined.
\sa toAscii(), toLatin1(), toUtf8(), toLocal8Bit() \sa toAscii(), toLatin1(), toUtf8(), toLocal8Bit()
*/ */

View File

@ -47,9 +47,7 @@
#include <QtCore/qrefcount.h> #include <QtCore/qrefcount.h>
#include <QtCore/qnamespace.h> #include <QtCore/qnamespace.h>
#ifndef QT_NO_STL #include <string>
# include <string>
#endif // QT_NO_STL
#include <stdarg.h> #include <stdarg.h>
@ -614,12 +612,10 @@ public:
inline void push_front(QChar c) { prepend(c); } inline void push_front(QChar c) { prepend(c); }
inline void push_front(const QString &s) { prepend(s); } inline void push_front(const QString &s) { prepend(s); }
#ifndef QT_NO_STL
static inline QString fromStdString(const std::string &s); static inline QString fromStdString(const std::string &s);
inline std::string toStdString() const; inline std::string toStdString() const;
static inline QString fromStdWString(const std::wstring &s); static inline QString fromStdWString(const std::wstring &s);
inline std::wstring toStdWString() const; inline std::wstring toStdWString() const;
#endif
// compatibility // compatibility
struct Null { }; struct Null { };
@ -1092,7 +1088,6 @@ inline QT_ASCII_CAST_WARN const QString operator+(const QString &s, const QByteA
# endif // QT_NO_CAST_FROM_ASCII # endif // QT_NO_CAST_FROM_ASCII
#endif // QT_USE_QSTRINGBUILDER #endif // QT_USE_QSTRINGBUILDER
#ifndef QT_NO_STL
inline std::string QString::toStdString() const inline std::string QString::toStdString() const
{ const QByteArray asc = toAscii(); return std::string(asc.constData(), asc.length()); } { const QByteArray asc = toAscii(); return std::string(asc.constData(), asc.length()); }
@ -1113,9 +1108,9 @@ inline std::wstring QString::toStdWString() const
str.resize(toWCharArray(&(*str.begin()))); str.resize(toWCharArray(&(*str.begin())));
return str; return str;
} }
inline QString QString::fromStdWString(const std::wstring &s) inline QString QString::fromStdWString(const std::wstring &s)
{ return fromWCharArray(s.data(), int(s.size())); } { return fromWCharArray(s.data(), int(s.size())); }
#endif
#if !defined(QT_NO_DATASTREAM) || (defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)) #if !defined(QT_NO_DATASTREAM) || (defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE))
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QString &); Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QString &);

View File

@ -47,10 +47,8 @@
#include <QtCore/qlist.h> #include <QtCore/qlist.h>
#include <QtCore/qrefcount.h> #include <QtCore/qrefcount.h>
#ifndef QT_NO_STL
#include <iterator> #include <iterator>
#include <vector> #include <vector>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef Q_COMPILER_INITIALIZER_LISTS #ifdef Q_COMPILER_INITIALIZER_LISTS
@ -308,12 +306,10 @@ public:
static QVector<T> fromList(const QList<T> &list); static QVector<T> fromList(const QList<T> &list);
#ifndef QT_NO_STL
static inline QVector<T> fromStdVector(const std::vector<T> &vector) static inline QVector<T> fromStdVector(const std::vector<T> &vector)
{ QVector<T> tmp; tmp.reserve(int(vector.size())); qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } { QVector<T> tmp; tmp.reserve(int(vector.size())); qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
inline std::vector<T> toStdVector() const inline std::vector<T> toStdVector() const
{ std::vector<T> tmp; tmp.reserve(size()); qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } { std::vector<T> tmp; tmp.reserve(size()); qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
#endif
private: private:
friend class QRegion; // Optimization for QRegion::rects() friend class QRegion; // Optimization for QRegion::rects()

View File

@ -876,7 +876,6 @@ void tst_QString::constructorQByteArray()
void tst_QString::STL() void tst_QString::STL()
{ {
#ifndef QT_NO_STL
#ifndef QT_NO_CAST_TO_ASCII #ifndef QT_NO_CAST_TO_ASCII
QString qt( "QString" ); QString qt( "QString" );
@ -920,9 +919,6 @@ void tst_QString::STL()
QCOMPARE(s, QString::fromLatin1("hello")); QCOMPARE(s, QString::fromLatin1("hello"));
QCOMPARE(stlStr, s.toStdWString()); QCOMPARE(stlStr, s.toStdWString());
#else
QSKIP( "Not tested without STL support");
#endif
} }
void tst_QString::truncate() void tst_QString::truncate()
@ -3360,7 +3356,6 @@ void tst_QString::fromStdString()
#ifdef Q_CC_HPACC #ifdef Q_CC_HPACC
QSKIP("This test crashes on HP-UX with aCC"); QSKIP("This test crashes on HP-UX with aCC");
#endif #endif
#if !defined(QT_NO_STL)
std::string stroustrup = "foo"; std::string stroustrup = "foo";
QString eng = QString::fromStdString( stroustrup ); QString eng = QString::fromStdString( stroustrup );
QCOMPARE( eng, QString("foo") ); QCOMPARE( eng, QString("foo") );
@ -3368,7 +3363,6 @@ void tst_QString::fromStdString()
std::string stdnull( cnull, sizeof(cnull)-1 ); std::string stdnull( cnull, sizeof(cnull)-1 );
QString qtnull = QString::fromStdString( stdnull ); QString qtnull = QString::fromStdString( stdnull );
QCOMPARE( qtnull.size(), int(stdnull.size()) ); QCOMPARE( qtnull.size(), int(stdnull.size()) );
#endif
} }
void tst_QString::toStdString() void tst_QString::toStdString()
@ -3376,7 +3370,6 @@ void tst_QString::toStdString()
#ifdef Q_CC_HPACC #ifdef Q_CC_HPACC
QSKIP("This test crashes on HP-UX with aCC"); QSKIP("This test crashes on HP-UX with aCC");
#endif #endif
#if !defined(QT_NO_STL)
QString nord = "foo"; QString nord = "foo";
std::string stroustrup1 = nord.toStdString(); std::string stroustrup1 = nord.toStdString();
QVERIFY( qstrcmp(stroustrup1.c_str(), "foo") == 0 ); QVERIFY( qstrcmp(stroustrup1.c_str(), "foo") == 0 );
@ -3390,7 +3383,6 @@ void tst_QString::toStdString()
QString qtnull( qcnull, sizeof(qcnull)/sizeof(QChar) ); QString qtnull( qcnull, sizeof(qcnull)/sizeof(QChar) );
std::string stdnull = qtnull.toStdString(); std::string stdnull = qtnull.toStdString();
QCOMPARE( int(stdnull.size()), qtnull.size() ); QCOMPARE( int(stdnull.size()), qtnull.size() );
#endif
} }
void tst_QString::utf8() void tst_QString::utf8()

View File

@ -78,9 +78,7 @@ void foo()
#include <QtTest/QtTest> #include <QtTest/QtTest>
#ifndef QT_NO_STL #include <algorithm>
# include <algorithm>
#endif
#include "qalgorithms.h" #include "qalgorithms.h"
#include "qbitarray.h" #include "qbitarray.h"
@ -136,14 +134,12 @@ private slots:
void conversions(); void conversions();
void javaStyleIterators(); void javaStyleIterators();
void constAndNonConstStlIterators(); void constAndNonConstStlIterators();
#ifndef QT_NO_STL
void vector_stl_data(); void vector_stl_data();
void vector_stl(); void vector_stl();
void list_stl_data(); void list_stl_data();
void list_stl(); void list_stl();
void linkedlist_stl_data(); void linkedlist_stl_data();
void linkedlist_stl(); void linkedlist_stl();
#endif
void q_init(); void q_init();
void pointersize(); void pointersize();
void containerInstantiation(); void containerInstantiation();
@ -228,7 +224,7 @@ void tst_Collections::list()
QVERIFY(list.size() == 6); QVERIFY(list.size() == 6);
QVERIFY(list.end() - list.begin() == list.size()); QVERIFY(list.end() - list.begin() == list.size());
#if !defined(QT_NO_STL) && !defined(Q_CC_MSVC) && !defined(Q_CC_SUN) #if !defined(Q_CC_MSVC) && !defined(Q_CC_SUN)
QVERIFY(std::binary_search(list.begin(), list.end(), 2) == true); QVERIFY(std::binary_search(list.begin(), list.end(), 2) == true);
QVERIFY(std::binary_search(list.begin(), list.end(), 9) == false); QVERIFY(std::binary_search(list.begin(), list.end(), 9) == false);
#endif #endif
@ -1038,10 +1034,8 @@ void tst_Collections::vector()
v.prepend(1); v.prepend(1);
v << 3 << 4 << 5 << 6; v << 3 << 4 << 5 << 6;
#if !defined(QT_NO_STL)
QVERIFY(std::binary_search(v.begin(), v.end(), 2) == true); QVERIFY(std::binary_search(v.begin(), v.end(), 2) == true);
QVERIFY(std::binary_search(v.begin(), v.end(), 9) == false); QVERIFY(std::binary_search(v.begin(), v.end(), 9) == false);
#endif
QVERIFY(qBinaryFind(v.begin(), v.end(), 2) == v.begin() + 1); QVERIFY(qBinaryFind(v.begin(), v.end(), 2) == v.begin() + 1);
QVERIFY(qLowerBound(v.begin(), v.end(), 2) == v.begin() + 1); QVERIFY(qLowerBound(v.begin(), v.end(), 2) == v.begin() + 1);
QVERIFY(qUpperBound(v.begin(), v.end(), 2) == v.begin() + 2); QVERIFY(qUpperBound(v.begin(), v.end(), 2) == v.begin() + 2);
@ -2870,7 +2864,6 @@ void tst_Collections::constAndNonConstStlIterators()
testMapLikeStlIterators<QMultiHash<QString, QString> >(); testMapLikeStlIterators<QMultiHash<QString, QString> >();
} }
#ifndef QT_NO_STL
void tst_Collections::vector_stl_data() void tst_Collections::vector_stl_data()
{ {
QTest::addColumn<QStringList>("elements"); QTest::addColumn<QStringList>("elements");
@ -2953,7 +2946,6 @@ void tst_Collections::list_stl()
QCOMPARE(QList<QString>::fromStdList(stdList), list); QCOMPARE(QList<QString>::fromStdList(stdList), list);
} }
#endif
template <typename T> template <typename T>
T qtInit(T * = 0) T qtInit(T * = 0)
@ -3014,7 +3006,6 @@ void instantiateContainer()
ContainerType container; ContainerType container;
const ContainerType constContainer(container); const ContainerType constContainer(container);
#ifndef QT_NO_STL
typename ContainerType::const_iterator constIt; typename ContainerType::const_iterator constIt;
constIt = constContainer.begin(); constIt = constContainer.begin();
constIt = container.cbegin(); constIt = container.cbegin();
@ -3024,7 +3015,7 @@ void instantiateContainer()
constIt = constContainer.cend(); constIt = constContainer.cend();
container.constEnd(); container.constEnd();
Q_UNUSED(constIt) Q_UNUSED(constIt)
#endif
container.clear(); container.clear();
container.contains(value); container.contains(value);
container.count(); container.count();
@ -3043,12 +3034,10 @@ void instantiateMutableIterationContainer()
instantiateContainer<ContainerType, ValueType>(); instantiateContainer<ContainerType, ValueType>();
ContainerType container; ContainerType container;
#ifndef QT_NO_STL
typename ContainerType::iterator it; typename ContainerType::iterator it;
it = container.begin(); it = container.begin();
it = container.end(); it = container.end();
Q_UNUSED(it) Q_UNUSED(it)
#endif
// QSet lacks count(T). // QSet lacks count(T).
const ValueType value = ValueType(); const ValueType value = ValueType();
@ -3622,10 +3611,8 @@ struct IntOrString
IntOrString(const QString &v) : val(v.toInt()) { } IntOrString(const QString &v) : val(v.toInt()) { }
operator int() { return val; } operator int() { return val; }
operator QString() { return QString::number(val); } operator QString() { return QString::number(val); }
#ifndef QT_NO_STL
operator std::string() { return QString::number(val).toStdString(); } operator std::string() { return QString::number(val).toStdString(); }
IntOrString(const std::string &v) : val(QString::fromStdString(v).toInt()) { } IntOrString(const std::string &v) : val(QString::fromStdString(v).toInt()) { }
#endif
}; };
template<class Container> void insert_remove_loop_impl() template<class Container> void insert_remove_loop_impl()
@ -3742,14 +3729,12 @@ void tst_Collections::insert_remove_loop()
insert_remove_loop_impl<QVarLengthArray<int, 15> >(); insert_remove_loop_impl<QVarLengthArray<int, 15> >();
insert_remove_loop_impl<QVarLengthArray<QString, 15> >(); insert_remove_loop_impl<QVarLengthArray<QString, 15> >();
#ifndef QT_NO_STL
insert_remove_loop_impl<ExtList<std::string> >(); insert_remove_loop_impl<ExtList<std::string> >();
insert_remove_loop_impl<QVector<std::string> >(); insert_remove_loop_impl<QVector<std::string> >();
insert_remove_loop_impl<QVarLengthArray<std::string> >(); insert_remove_loop_impl<QVarLengthArray<std::string> >();
insert_remove_loop_impl<QVarLengthArray<std::string, 10> >(); insert_remove_loop_impl<QVarLengthArray<std::string, 10> >();
insert_remove_loop_impl<QVarLengthArray<std::string, 3> >(); insert_remove_loop_impl<QVarLengthArray<std::string, 3> >();
insert_remove_loop_impl<QVarLengthArray<std::string, 15> >(); insert_remove_loop_impl<QVarLengthArray<std::string, 15> >();
#endif
} }

View File

@ -163,7 +163,6 @@ void tst_QStringList::split_qlist_qstring() const
void tst_QStringList::split_stdvector_stdstring() const void tst_QStringList::split_stdvector_stdstring() const
{ {
#ifndef QT_NO_STL
QFETCH(QString, input); QFETCH(QString, input);
const char split_char = ':'; const char split_char = ':';
std::string stdinput = input.toStdString(); std::string stdinput = input.toStdString();
@ -176,12 +175,10 @@ void tst_QStringList::split_stdvector_stdstring() const
token.push_back(each)) token.push_back(each))
; ;
} }
#endif
} }
void tst_QStringList::split_stdvector_stdwstring() const void tst_QStringList::split_stdvector_stdwstring() const
{ {
#ifndef QT_NO_STL
QFETCH(QString, input); QFETCH(QString, input);
const wchar_t split_char = ':'; const wchar_t split_char = ':';
std::wstring stdinput = input.toStdWString(); std::wstring stdinput = input.toStdWString();
@ -194,7 +191,6 @@ void tst_QStringList::split_stdvector_stdwstring() const
token.push_back(each)) token.push_back(each))
; ;
} }
#endif
} }
void tst_QStringList::split_stdlist_stdstring() const void tst_QStringList::split_stdlist_stdstring() const

View File

@ -48,10 +48,8 @@
#include <QtCore/qalgorithms.h> #include <QtCore/qalgorithms.h>
#include <QtCore/qlist.h> #include <QtCore/qlist.h>
#ifndef QT_NO_STL
#include <iterator> #include <iterator>
#include <vector> #include <vector>
#endif
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -253,12 +251,10 @@ public:
//static QRawVector<T> fromList(const QList<T> &list); //static QRawVector<T> fromList(const QList<T> &list);
#ifndef QT_NO_STL
static inline QRawVector<T> fromStdVector(const std::vector<T> &vector) static inline QRawVector<T> fromStdVector(const std::vector<T> &vector)
{ QRawVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } { QRawVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
inline std::vector<T> toStdVector() const inline std::vector<T> toStdVector() const
{ std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } { std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
#endif
private: private:
T *allocate(int alloc); T *allocate(int alloc);