61 QLinkedListData *
n, *
p;
88 #ifdef Q_COMPILER_RVALUE_REFS
90 {
qSwap(
d, other.d);
return *
this; }
98 {
if (
d->
ref != 1) detach_helper(); }
114 int count(
const T &
t)
const;
144 { Node *
n =
i;
if (j > 0)
while (j--) n = n->
n;
else while (j++) n = n->
p;
return n; }
174 { Node *
n =
i;
if (j > 0)
while (j--) n = n->
n;
else while (j++) n = n->
p;
return n; }
225 {
QLinkedList<T> tmp;
qCopy(list.begin(), list.end(), std::back_inserter(tmp));
return tmp; }
233 inline QT3_SUPPORT
int findIndex(
const T&
t)
const
236 {
while (from !=
end() && !(*from == t)) ++from;
return from; }
237 inline QT3_SUPPORT
iterator find(
const T& t)
238 {
return find(
begin(), t); }
240 {
while (from !=
end() && !(*from == t)) ++from;
return from; }
242 {
return find(
begin(), t); }
250 inline QLinkedList<T> &operator<<(const QLinkedList<T> &l) { *
this += l;
return *
this; }
253 void detach_helper();
257 template <
typename T>
266 template <
typename T>
273 x.d->sharable =
true;
274 Node *original = e->n;
276 while (original != e) {
278 copy->n =
new Node(original->t);
280 original = original->n;
295 template <
typename T>
298 Node *
y =
reinterpret_cast<Node*
>(
x);
310 template <
typename T>
316 template <
typename T>
331 template <
typename T>
334 if (d->size != l.
d->
size)
341 if (! (i->
t == il->
t))
349 template <
typename T>
353 Node *i =
new Node(t);
361 template <
typename T>
365 Node *i =
new Node(t);
373 template <
typename T>
396 template <
typename T>
408 template <
typename T>
416 template <
typename T>
424 template <
typename T>
428 while ((i = i->
n) != e)
434 template <
typename T>
439 while ((i = i->
n) != e)
446 template <
typename T>
450 Node *m =
new Node(t);
459 template <
typename T>
463 while (afirst != alast)
469 template <
typename T>
485 template <
typename T>
491 Node *original = l.
e->n;
494 Node *copy =
new Node(original->
t);
495 original = original->
n;
510 template <
typename T>
525 #endif // QLINKEDLIST_H
iterator & operator+=(int j)
const_iterator constBegin() const
iterator operator-(int j) const
void push_front(const T &t)
bool operator!=(const const_iterator &o) const
const_iterator & operator=(const const_iterator &o)
iterator insert(iterator before, const T &t)
InputIterator qFind(InputIterator first, InputIterator last, const T &val)
const T * operator->() const
#define Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(C)
iterator erase(iterator pos)
const_iterator & operator-=(int j)
const_iterator(iterator ci)
iterator & operator=(const iterator &o)
bool operator==(const const_iterator &o) const
QLinkedListNode(const T &arg)
bool removeOne(const T &t)
#define QT_BEGIN_NAMESPACE
#define Q_DECLARE_SEQUENTIAL_ITERATOR(C)
void setSharable(bool sharable)
iterator(const iterator &o)
const value_type & const_reference
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
std::list< T > toStdList() const
QLinkedList< T > & operator<<(const T &t)
bool operator!=(const const_iterator &o) const
std::bidirectional_iterator_tag iterator_category
std::bidirectional_iterator_tag iterator_category
bool operator==(const const_iterator &o) const
int removeAll(const T &t)
static QLinkedListData shared_null
const value_type * const_pointer
const_iterator operator++(int)
bool isSharedWith(const QLinkedList< T > &other) const
const_iterator ConstIterator
const_iterator constEnd() const
const_iterator begin() const
static QLinkedList< T > fromStdList(const std::list< T > &list)
void push_back(const T &t)
QLinkedList< T > & operator=(const QLinkedList< T > &)
const_iterator operator--(int)
const_iterator operator-(int j) const
QLinkedList< T > operator+(const QLinkedList< T > &l) const
void swap(QLinkedList< T > &other)
QLinkedList(const QLinkedList< T > &l)
iterator operator+(int j) const
QLinkedList< T > & operator+=(const T &t)
const_iterator & operator+=(int j)
bool operator!=(const iterator &o) const
const T & operator*() const
OutputIterator qCopy(InputIterator begin, InputIterator end, OutputIterator dest)
bool operator==(const QLinkedList< T > &l) const
QLinkedList< T > & operator+=(const QLinkedList< T > &l)
bool startsWith(const T &t) const
iterator & operator-=(int j)
friend class const_iterator
const_iterator end() const
bool endsWith(const T &t) const
const_iterator & operator++()
bool contains(const T &t) const
const_iterator operator+(int j) const
const_iterator(const const_iterator &o)
const_iterator & operator--()
bool operator==(const iterator &o) const
bool operator!=(const QLinkedList< T > &l) const