Get rid of some QT_STRICT_ITERATORS leftover
Amends 06456873fceddcd340431fc5999c50ff6d3c2371. Fixes: QTBUG-82611 Change-Id: I8b1e01549f3e910b85a571833237e38a7c2b49a9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
4f7cc72298
commit
d1882c79f2
@ -192,7 +192,6 @@ headersclean:!internal_module {
|
||||
hcleanDEFS = -DQT_NO_CAST_TO_ASCII=1 \
|
||||
-DQT_NO_CAST_FROM_ASCII=1 \
|
||||
-UQT_RESTRICTED_CAST_FROM_ASCII \
|
||||
-DQT_STRICT_ITERATORS \
|
||||
-DQT_NO_URL_CAST_FROM_STRING=1 \
|
||||
-DQT_NO_CAST_FROM_BYTEARRAY=1 \
|
||||
-DQT_NO_KEYWORDS=1 \
|
||||
|
@ -198,81 +198,8 @@ template <class T>
|
||||
struct QTypedArrayData
|
||||
: QArrayData
|
||||
{
|
||||
#ifdef QT_STRICT_ITERATORS
|
||||
class iterator {
|
||||
public:
|
||||
T *i;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
typedef int difference_type;
|
||||
typedef T value_type;
|
||||
typedef T *pointer;
|
||||
typedef T &reference;
|
||||
|
||||
inline iterator() : i(nullptr) {}
|
||||
inline iterator(T *n) : i(n) {}
|
||||
inline iterator(const iterator &o): i(o.i){} // #### Qt 6: remove, the implicit version is fine
|
||||
inline T &operator*() const { return *i; }
|
||||
inline T *operator->() const { return i; }
|
||||
inline T &operator[](int j) const { return *(i + j); }
|
||||
inline bool operator==(const iterator &o) const { return i == o.i; }
|
||||
inline bool operator!=(const iterator &o) const { return i != o.i; }
|
||||
inline bool operator<(const iterator& other) const { return i < other.i; }
|
||||
inline bool operator<=(const iterator& other) const { return i <= other.i; }
|
||||
inline bool operator>(const iterator& other) const { return i > other.i; }
|
||||
inline bool operator>=(const iterator& other) const { return i >= other.i; }
|
||||
inline iterator &operator++() { ++i; return *this; }
|
||||
inline iterator operator++(int) { T *n = i; ++i; return n; }
|
||||
inline iterator &operator--() { i--; return *this; }
|
||||
inline iterator operator--(int) { T *n = i; i--; return n; }
|
||||
inline iterator &operator+=(int j) { i+=j; return *this; }
|
||||
inline iterator &operator-=(int j) { i-=j; return *this; }
|
||||
inline iterator operator+(int j) const { return iterator(i+j); }
|
||||
inline iterator operator-(int j) const { return iterator(i-j); }
|
||||
friend inline iterator operator+(int j, iterator k) { return k + j; }
|
||||
inline int operator-(iterator j) const { return i - j.i; }
|
||||
inline operator T*() const { return i; }
|
||||
};
|
||||
friend class iterator;
|
||||
|
||||
class const_iterator {
|
||||
public:
|
||||
const T *i;
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
typedef int difference_type;
|
||||
typedef T value_type;
|
||||
typedef const T *pointer;
|
||||
typedef const T &reference;
|
||||
|
||||
inline const_iterator() : i(nullptr) {}
|
||||
inline const_iterator(const T *n) : i(n) {}
|
||||
inline const_iterator(const const_iterator &o): i(o.i) {} // #### Qt 6: remove, the default version is fine
|
||||
inline explicit const_iterator(const iterator &o): i(o.i) {}
|
||||
inline const T &operator*() const { return *i; }
|
||||
inline const T *operator->() const { return i; }
|
||||
inline const T &operator[](int j) const { return *(i + j); }
|
||||
inline bool operator==(const const_iterator &o) const { return i == o.i; }
|
||||
inline bool operator!=(const const_iterator &o) const { return i != o.i; }
|
||||
inline bool operator<(const const_iterator& other) const { return i < other.i; }
|
||||
inline bool operator<=(const const_iterator& other) const { return i <= other.i; }
|
||||
inline bool operator>(const const_iterator& other) const { return i > other.i; }
|
||||
inline bool operator>=(const const_iterator& other) const { return i >= other.i; }
|
||||
inline const_iterator &operator++() { ++i; return *this; }
|
||||
inline const_iterator operator++(int) { const T *n = i; ++i; return n; }
|
||||
inline const_iterator &operator--() { i--; return *this; }
|
||||
inline const_iterator operator--(int) { const T *n = i; i--; return n; }
|
||||
inline const_iterator &operator+=(int j) { i+=j; return *this; }
|
||||
inline const_iterator &operator-=(int j) { i-=j; return *this; }
|
||||
inline const_iterator operator+(int j) const { return const_iterator(i+j); }
|
||||
inline const_iterator operator-(int j) const { return const_iterator(i-j); }
|
||||
friend inline const_iterator operator+(int j, const_iterator k) { return k + j; }
|
||||
inline int operator-(const_iterator j) const { return i - j.i; }
|
||||
inline operator const T*() const { return i; }
|
||||
};
|
||||
friend class const_iterator;
|
||||
#else
|
||||
typedef T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
#endif
|
||||
|
||||
class AlignmentDummy { QArrayData header; T data; };
|
||||
|
||||
|
@ -7,8 +7,6 @@
|
||||
add_qt_test(tst_qtconcurrentfilter
|
||||
SOURCES
|
||||
tst_qtconcurrentfilter.cpp
|
||||
DEFINES
|
||||
-QT_NO_LINKED_LIST
|
||||
PUBLIC_LIBRARIES
|
||||
Qt::Concurrent
|
||||
)
|
||||
|
@ -4,12 +4,9 @@
|
||||
## tst_qtconcurrentfilter Test:
|
||||
#####################################################################
|
||||
|
||||
add_qt_test(tst_qtconcurrentfilter
|
||||
qt_add_test(tst_qtconcurrentfilter
|
||||
SOURCES
|
||||
tst_qtconcurrentfilter.cpp
|
||||
DEFINES
|
||||
# -QT_NO_LINKED_LIST # special case remove until figured out how to deal with this
|
||||
QT_STRICT_ITERATORS
|
||||
PUBLIC_LIBRARIES
|
||||
Qt::Concurrent
|
||||
)
|
||||
|
@ -4,12 +4,9 @@
|
||||
## tst_qtconcurrentmap Test:
|
||||
#####################################################################
|
||||
|
||||
add_qt_test(tst_qtconcurrentmap
|
||||
qt_add_test(tst_qtconcurrentmap
|
||||
SOURCES
|
||||
tst_qtconcurrentmap.cpp
|
||||
DEFINES
|
||||
# -QT_NO_LINKED_LIST # special case remove until we figure this out
|
||||
QT_STRICT_ITERATORS
|
||||
PUBLIC_LIBRARIES
|
||||
Qt::Concurrent
|
||||
)
|
||||
|
@ -4,12 +4,11 @@
|
||||
## tst_qfuture Test:
|
||||
#####################################################################
|
||||
|
||||
add_qt_test(tst_qfuture
|
||||
qt_add_test(tst_qfuture
|
||||
SOURCES
|
||||
tst_qfuture.cpp
|
||||
DEFINES
|
||||
# -QT_NO_JAVA_STYLE_ITERATORS # special case
|
||||
QT_STRICT_ITERATORS
|
||||
# DEFINES
|
||||
# -QT_NO_JAVA_STYLE_ITERATORS
|
||||
PUBLIC_LIBRARIES
|
||||
Qt::CorePrivate
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user