T *data() { return static_cast<T *>(QArrayData::data()); }
const T *data() const { return static_cast<const T *>(QArrayData::data()); }
- iterator begin() { return data(); }
- iterator end() { return data() + size; }
- const_iterator begin() const { return data(); }
- const_iterator end() const { return data() + size; }
- const_iterator constBegin() const { return data(); }
- const_iterator constEnd() const { return data() + size; }
+ iterator begin(iterator = iterator()) { return data(); }
+ iterator end(iterator = iterator()) { return data() + size; }
+ const_iterator begin(const_iterator = const_iterator()) const { return data(); }
+ const_iterator end(const_iterator = const_iterator()) const { return data() + size; }
+ const_iterator constBegin(const_iterator = const_iterator()) const { return data(); }
+ const_iterator constEnd(const_iterator = const_iterator()) const { return data() + size; }
class AlignmentDummy { QArrayData header; T data; };
// STL-style
typedef typename Data::iterator iterator;
typedef typename Data::const_iterator const_iterator;
+#if !defined(QT_STRICT_ITERATORS) || defined(Q_QDOC)
inline iterator begin() { detach(); return d->begin(); }
inline const_iterator begin() const { return d->constBegin(); }
inline const_iterator cbegin() const { return d->constBegin(); }
inline const_iterator end() const { return d->constEnd(); }
inline const_iterator cend() const { return d->constEnd(); }
inline const_iterator constEnd() const { return d->constEnd(); }
+#else
+ inline iterator begin(iterator = iterator()) { detach(); return d->begin(); }
+ inline const_iterator begin(const_iterator = const_iterator()) const { return d->constBegin(); }
+ inline const_iterator cbegin(const_iterator = const_iterator()) const { return d->constBegin(); }
+ inline const_iterator constBegin(const_iterator = const_iterator()) const { return d->constBegin(); }
+ inline iterator end(iterator = iterator()) { detach(); return d->end(); }
+ inline const_iterator end(const_iterator = const_iterator()) const { return d->constEnd(); }
+ inline const_iterator cend(const_iterator = const_iterator()) const { return d->constEnd(); }
+ inline const_iterator constEnd(const_iterator = const_iterator()) const { return d->constEnd(); }
+#endif
iterator insert(iterator before, int n, const T &x);
inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
iterator erase(iterator begin, iterator end);