QDataStream: move QLinkedlist operators to qlinkedlist.h

This is in preparation of deprecating QLinkedList.

Change-Id: I7540b784736a48cf4857d1969440d35ec64457e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2019-05-02 20:28:50 +02:00
parent bd25689003
commit c493076a04
2 changed files with 15 additions and 13 deletions

View File

@ -55,7 +55,6 @@ class QByteArray;
class QIODevice; class QIODevice;
template <typename T> class QList; template <typename T> class QList;
template <typename T> class QLinkedList;
template <typename T> class QVector; template <typename T> class QVector;
template <typename T> class QSet; template <typename T> class QSet;
template <class Key, class T> class QHash; template <class Key, class T> class QHash;
@ -407,18 +406,6 @@ inline QDataStream &operator<<(QDataStream &s, const QList<T> &l)
return QtPrivate::writeSequentialContainer(s, l); return QtPrivate::writeSequentialContainer(s, l);
} }
template <typename T>
inline QDataStream &operator>>(QDataStream &s, QLinkedList<T> &l)
{
return QtPrivate::readListBasedContainer(s, l);
}
template <typename T>
inline QDataStream &operator<<(QDataStream &s, const QLinkedList<T> &l)
{
return QtPrivate::writeSequentialContainer(s, l);
}
template<typename T> template<typename T>
inline QDataStream &operator>>(QDataStream &s, QVector<T> &v) inline QDataStream &operator>>(QDataStream &s, QVector<T> &v)
{ {

View File

@ -43,6 +43,7 @@
#include <QtCore/qiterator.h> #include <QtCore/qiterator.h>
#include <QtCore/qrefcount.h> #include <QtCore/qrefcount.h>
#include <QtCore/qcontainertools_impl.h> #include <QtCore/qcontainertools_impl.h>
#include <QtCore/qdatastream.h>
#include <algorithm> #include <algorithm>
#include <initializer_list> #include <initializer_list>
@ -561,6 +562,20 @@ QLinkedList<T> QLinkedList<T>::operator+(const QLinkedList<T> &l) const
Q_DECLARE_SEQUENTIAL_ITERATOR(LinkedList) Q_DECLARE_SEQUENTIAL_ITERATOR(LinkedList)
Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(LinkedList) Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(LinkedList)
#ifndef QT_NO_DATASTREAM
template <typename T>
inline QDataStream &operator>>(QDataStream &s, QLinkedList<T> &l)
{
return QtPrivate::readListBasedContainer(s, l);
}
template <typename T>
inline QDataStream &operator<<(QDataStream &s, const QLinkedList<T> &l)
{
return QtPrivate::writeSequentialContainer(s, l);
}
#endif
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QLINKEDLIST_H #endif // QLINKEDLIST_H