QtCore: mark some operations nothrow
This shotgun-surgery approach is motivated by trying to get a clean(er) build for -Wnoexcept on GCC, so it is expected that for any class touched here, there will be more operations that can be marked nothrow. But they don't show up in conditional noexcept clauses, yet, so they are deferred to some later commit. Change-Id: I0eb10d75a26c361fb22cf785399e83b434bdf233 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
2c2801860d
commit
390b16aea8
@ -85,7 +85,7 @@ public:
|
|||||||
inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; }
|
inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; }
|
||||||
inline QDebug &operator=(const QDebug &other);
|
inline QDebug &operator=(const QDebug &other);
|
||||||
~QDebug();
|
~QDebug();
|
||||||
inline void swap(QDebug &other) { qSwap(stream, other.stream); }
|
inline void swap(QDebug &other) Q_DECL_NOTHROW { qSwap(stream, other.stream); }
|
||||||
|
|
||||||
QDebug &resetFormat();
|
QDebug &resetFormat();
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ public:
|
|||||||
QByteArray key;
|
QByteArray key;
|
||||||
uint hash;
|
uint hash;
|
||||||
};
|
};
|
||||||
inline uint qHash(const QProcEnvKey &key) { return key.hash; }
|
inline uint qHash(const QProcEnvKey &key) Q_DECL_NOTHROW { return key.hash; }
|
||||||
|
|
||||||
class QProcEnvValue
|
class QProcEnvValue
|
||||||
{
|
{
|
||||||
|
@ -173,14 +173,14 @@ public:
|
|||||||
QUrl &operator=(const QString &url);
|
QUrl &operator=(const QString &url);
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
QUrl(QUrl &&other) : d(0)
|
QUrl(QUrl &&other) Q_DECL_NOTHROW : d(other.d)
|
||||||
{ qSwap(d, other.d); }
|
{ other.d = Q_NULLPTR; }
|
||||||
inline QUrl &operator=(QUrl &&other)
|
inline QUrl &operator=(QUrl &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
~QUrl();
|
~QUrl();
|
||||||
|
|
||||||
inline void swap(QUrl &other) { qSwap(d, other.d); }
|
inline void swap(QUrl &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
|
||||||
|
|
||||||
void setUrl(const QString &url, ParsingMode mode = TolerantMode);
|
void setUrl(const QString &url, ParsingMode mode = TolerantMode);
|
||||||
QString url(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
|
QString url(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
|
||||||
|
@ -91,7 +91,7 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QModelIndex &);
|
|||||||
class QPersistentModelIndexData;
|
class QPersistentModelIndexData;
|
||||||
|
|
||||||
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
|
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
|
||||||
uint qHash(const QPersistentModelIndex &index, uint seed = 0);
|
uint qHash(const QPersistentModelIndex &index, uint seed = 0) Q_DECL_NOTHROW;
|
||||||
|
|
||||||
class Q_CORE_EXPORT QPersistentModelIndex
|
class Q_CORE_EXPORT QPersistentModelIndex
|
||||||
{
|
{
|
||||||
@ -106,11 +106,12 @@ public:
|
|||||||
{ return !operator==(other); }
|
{ return !operator==(other); }
|
||||||
QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
|
QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QPersistentModelIndex(QPersistentModelIndex &&other) : d(other.d) { other.d = 0; }
|
inline QPersistentModelIndex(QPersistentModelIndex &&other) Q_DECL_NOTHROW
|
||||||
inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other)
|
: d(other.d) { other.d = Q_NULLPTR; }
|
||||||
|
inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
inline void swap(QPersistentModelIndex &other) { qSwap(d, other.d); }
|
inline void swap(QPersistentModelIndex &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
|
||||||
bool operator==(const QModelIndex &other) const;
|
bool operator==(const QModelIndex &other) const;
|
||||||
bool operator!=(const QModelIndex &other) const;
|
bool operator!=(const QModelIndex &other) const;
|
||||||
QPersistentModelIndex &operator=(const QModelIndex &other);
|
QPersistentModelIndex &operator=(const QModelIndex &other);
|
||||||
@ -128,14 +129,14 @@ public:
|
|||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
private:
|
private:
|
||||||
QPersistentModelIndexData *d;
|
QPersistentModelIndexData *d;
|
||||||
friend uint qHash(const QPersistentModelIndex &, uint seed);
|
friend uint qHash(const QPersistentModelIndex &, uint seed) Q_DECL_NOTHROW;
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QPersistentModelIndex &);
|
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QPersistentModelIndex &);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
Q_DECLARE_SHARED(QPersistentModelIndex)
|
Q_DECLARE_SHARED(QPersistentModelIndex)
|
||||||
|
|
||||||
inline uint qHash(const QPersistentModelIndex &index, uint seed)
|
inline uint qHash(const QPersistentModelIndex &index, uint seed) Q_DECL_NOTHROW
|
||||||
{ return qHash(index.d, seed); }
|
{ return qHash(index.d, seed); }
|
||||||
|
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ QCoreApplication *QCoreApplication::self = 0;
|
|||||||
uint QCoreApplicationPrivate::attribs = (1 << Qt::AA_SynthesizeMouseForUnhandledTouchEvents);
|
uint QCoreApplicationPrivate::attribs = (1 << Qt::AA_SynthesizeMouseForUnhandledTouchEvents);
|
||||||
|
|
||||||
struct QCoreApplicationData {
|
struct QCoreApplicationData {
|
||||||
QCoreApplicationData() {
|
QCoreApplicationData() Q_DECL_NOTHROW {
|
||||||
#ifndef QT_NO_LIBRARY
|
#ifndef QT_NO_LIBRARY
|
||||||
app_libpaths = 0;
|
app_libpaths = 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -253,13 +253,13 @@ class Q_CORE_EXPORT QVariant
|
|||||||
|
|
||||||
QVariant& operator=(const QVariant &other);
|
QVariant& operator=(const QVariant &other);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QVariant(QVariant &&other) : d(other.d)
|
inline QVariant(QVariant &&other) Q_DECL_NOTHROW : d(other.d)
|
||||||
{ other.d = Private(); }
|
{ other.d = Private(); }
|
||||||
inline QVariant &operator=(QVariant &&other)
|
inline QVariant &operator=(QVariant &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline void swap(QVariant &other) { qSwap(d, other.d); }
|
inline void swap(QVariant &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
|
||||||
|
|
||||||
Type type() const;
|
Type type() const;
|
||||||
int userType() const;
|
int userType() const;
|
||||||
@ -360,15 +360,15 @@ class Q_CORE_EXPORT QVariant
|
|||||||
};
|
};
|
||||||
struct Private
|
struct Private
|
||||||
{
|
{
|
||||||
inline Private(): type(Invalid), is_shared(false), is_null(true)
|
inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true)
|
||||||
{ data.ptr = 0; }
|
{ data.ptr = 0; }
|
||||||
|
|
||||||
// Internal constructor for initialized variants.
|
// Internal constructor for initialized variants.
|
||||||
explicit inline Private(uint variantType)
|
explicit inline Private(uint variantType) Q_DECL_NOTHROW
|
||||||
: type(variantType), is_shared(false), is_null(false)
|
: type(variantType), is_shared(false), is_null(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
inline Private(const Private &other)
|
inline Private(const Private &other) Q_DECL_NOTHROW
|
||||||
: data(other.data), type(other.type),
|
: data(other.data), type(other.type),
|
||||||
is_shared(other.is_shared), is_null(other.is_null)
|
is_shared(other.is_shared), is_null(other.is_null)
|
||||||
{}
|
{}
|
||||||
|
@ -113,7 +113,7 @@ struct Q_CORE_EXPORT QArrayData
|
|||||||
size_t alignment) Q_DECL_NOTHROW;
|
size_t alignment) Q_DECL_NOTHROW;
|
||||||
|
|
||||||
static const QArrayData shared_null[2];
|
static const QArrayData shared_null[2];
|
||||||
static QArrayData *sharedNull() { return const_cast<QArrayData*>(shared_null); }
|
static QArrayData *sharedNull() Q_DECL_NOTHROW { return const_cast<QArrayData*>(shared_null); }
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QArrayData::AllocationOptions)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(QArrayData::AllocationOptions)
|
||||||
@ -237,7 +237,7 @@ struct QTypedArrayData
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QTypedArrayData *sharedNull()
|
static QTypedArrayData *sharedNull() Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));
|
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));
|
||||||
return static_cast<QTypedArrayData *>(QArrayData::sharedNull());
|
return static_cast<QTypedArrayData *>(QArrayData::sharedNull());
|
||||||
|
@ -53,12 +53,12 @@ public:
|
|||||||
QBitArray(const QBitArray &other) : d(other.d) {}
|
QBitArray(const QBitArray &other) : d(other.d) {}
|
||||||
inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; }
|
inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; }
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QBitArray(QBitArray &&other) : d(std::move(other.d)) {}
|
inline QBitArray(QBitArray &&other) Q_DECL_NOTHROW : d(std::move(other.d)) {}
|
||||||
inline QBitArray &operator=(QBitArray &&other)
|
inline QBitArray &operator=(QBitArray &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline void swap(QBitArray &other) { qSwap(d, other.d); }
|
inline void swap(QBitArray &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
|
||||||
|
|
||||||
inline int size() const { return (d.size() << 3) - *d.constData(); }
|
inline int size() const { return (d.size() << 3) - *d.constData(); }
|
||||||
inline int count() const { return (d.size() << 3) - *d.constData(); }
|
inline int count() const { return (d.size() << 3) - *d.constData(); }
|
||||||
|
@ -195,12 +195,13 @@ public:
|
|||||||
QByteArray &operator=(const QByteArray &);
|
QByteArray &operator=(const QByteArray &);
|
||||||
QByteArray &operator=(const char *str);
|
QByteArray &operator=(const char *str);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QByteArray(QByteArray && other) : d(other.d) { other.d = Data::sharedNull(); }
|
inline QByteArray(QByteArray && other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
|
||||||
inline QByteArray &operator=(QByteArray &&other)
|
inline QByteArray &operator=(QByteArray &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline void swap(QByteArray &other) { qSwap(d, other.d); }
|
inline void swap(QByteArray &other) Q_DECL_NOTHROW
|
||||||
|
{ qSwap(d, other.d); }
|
||||||
|
|
||||||
inline int size() const;
|
inline int size() const;
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
|
@ -83,7 +83,7 @@ class QCache
|
|||||||
Q_DISABLE_COPY(QCache)
|
Q_DISABLE_COPY(QCache)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline explicit QCache(int maxCost = 100);
|
inline explicit QCache(int maxCost = 100) Q_DECL_NOTHROW;
|
||||||
inline ~QCache() { clear(); }
|
inline ~QCache() { clear(); }
|
||||||
|
|
||||||
inline int maxCost() const { return mx; }
|
inline int maxCost() const { return mx; }
|
||||||
@ -110,7 +110,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class Key, class T>
|
template <class Key, class T>
|
||||||
inline QCache<Key, T>::QCache(int amaxCost)
|
inline QCache<Key, T>::QCache(int amaxCost) Q_DECL_NOTHROW
|
||||||
: f(0), l(0), mx(amaxCost), total(0) {}
|
: f(0), l(0), mx(amaxCost), total(0) {}
|
||||||
|
|
||||||
template <class Key, class T>
|
template <class Key, class T>
|
||||||
|
@ -52,10 +52,10 @@ public:
|
|||||||
~QCollatorSortKey();
|
~QCollatorSortKey();
|
||||||
QCollatorSortKey &operator=(const QCollatorSortKey &other);
|
QCollatorSortKey &operator=(const QCollatorSortKey &other);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QCollatorSortKey &operator=(QCollatorSortKey &&other)
|
inline QCollatorSortKey &operator=(QCollatorSortKey &&other) Q_DECL_NOTHROW
|
||||||
{ swap(other); return *this; }
|
{ swap(other); return *this; }
|
||||||
#endif
|
#endif
|
||||||
void swap(QCollatorSortKey &other)
|
void swap(QCollatorSortKey &other) Q_DECL_NOTHROW
|
||||||
{ d.swap(other.d); }
|
{ d.swap(other.d); }
|
||||||
|
|
||||||
int compare(const QCollatorSortKey &key) const;
|
int compare(const QCollatorSortKey &key) const;
|
||||||
@ -82,13 +82,13 @@ public:
|
|||||||
~QCollator();
|
~QCollator();
|
||||||
QCollator &operator=(const QCollator &);
|
QCollator &operator=(const QCollator &);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
QCollator(QCollator &&other)
|
QCollator(QCollator &&other) Q_DECL_NOTHROW
|
||||||
: d(other.d) { other.d = 0; }
|
: d(other.d) { other.d = 0; }
|
||||||
QCollator &operator=(QCollator &&other)
|
QCollator &operator=(QCollator &&other) Q_DECL_NOTHROW
|
||||||
{ swap(other); return *this; }
|
{ swap(other); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void swap(QCollator &other)
|
void swap(QCollator &other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); }
|
{ qSwap(d, other.d); }
|
||||||
|
|
||||||
void setLocale(const QLocale &locale);
|
void setLocale(const QLocale &locale);
|
||||||
|
@ -328,7 +328,7 @@ class QHash
|
|||||||
static inline int alignOfNode() { return qMax<int>(sizeof(void*), Q_ALIGNOF(Node)); }
|
static inline int alignOfNode() { return qMax<int>(sizeof(void*), Q_ALIGNOF(Node)); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline QHash() : d(const_cast<QHashData *>(&QHashData::shared_null)) { }
|
inline QHash() Q_DECL_NOTHROW : d(const_cast<QHashData *>(&QHashData::shared_null)) { }
|
||||||
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
||||||
inline QHash(std::initializer_list<std::pair<Key,T> > list)
|
inline QHash(std::initializer_list<std::pair<Key,T> > list)
|
||||||
: d(const_cast<QHashData *>(&QHashData::shared_null))
|
: d(const_cast<QHashData *>(&QHashData::shared_null))
|
||||||
@ -343,11 +343,11 @@ public:
|
|||||||
|
|
||||||
QHash<Key, T> &operator=(const QHash<Key, T> &other);
|
QHash<Key, T> &operator=(const QHash<Key, T> &other);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QHash(QHash<Key, T> &&other) : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
|
inline QHash(QHash<Key, T> &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
|
||||||
inline QHash<Key, T> &operator=(QHash<Key, T> &&other)
|
inline QHash<Key, T> &operator=(QHash<Key, T> &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
inline void swap(QHash<Key, T> &other) { qSwap(d, other.d); }
|
inline void swap(QHash<Key, T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
|
||||||
|
|
||||||
bool operator==(const QHash<Key, T> &other) const;
|
bool operator==(const QHash<Key, T> &other) const;
|
||||||
inline bool operator!=(const QHash<Key, T> &other) const { return !(*this == other); }
|
inline bool operator!=(const QHash<Key, T> &other) const { return !(*this == other); }
|
||||||
|
@ -112,7 +112,7 @@ class QList : public QListSpecialMethods<T>
|
|||||||
union { QListData p; QListData::Data *d; };
|
union { QListData p; QListData::Data *d; };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline QList() : d(const_cast<QListData::Data *>(&QListData::shared_null)) { }
|
inline QList() Q_DECL_NOTHROW : d(const_cast<QListData::Data *>(&QListData::shared_null)) { }
|
||||||
QList(const QList<T> &l);
|
QList(const QList<T> &l);
|
||||||
~QList();
|
~QList();
|
||||||
QList<T> &operator=(const QList<T> &l);
|
QList<T> &operator=(const QList<T> &l);
|
||||||
|
@ -77,11 +77,11 @@ public:
|
|||||||
QRegularExpression &operator=(const QRegularExpression &re);
|
QRegularExpression &operator=(const QRegularExpression &re);
|
||||||
|
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QRegularExpression &operator=(QRegularExpression &&re)
|
QRegularExpression &operator=(QRegularExpression &&re) Q_DECL_NOTHROW
|
||||||
{ d.swap(re.d); return *this; }
|
{ d.swap(re.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline void swap(QRegularExpression &re) { d.swap(re.d); }
|
void swap(QRegularExpression &other) Q_DECL_NOTHROW { d.swap(other.d); }
|
||||||
|
|
||||||
QString pattern() const;
|
QString pattern() const;
|
||||||
void setPattern(const QString &pattern);
|
void setPattern(const QString &pattern);
|
||||||
@ -169,10 +169,10 @@ public:
|
|||||||
QRegularExpressionMatch &operator=(const QRegularExpressionMatch &match);
|
QRegularExpressionMatch &operator=(const QRegularExpressionMatch &match);
|
||||||
|
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match)
|
QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match) Q_DECL_NOTHROW
|
||||||
{ d.swap(match.d); return *this; }
|
{ d.swap(match.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
inline void swap(QRegularExpressionMatch &match) { d.swap(match.d); }
|
void swap(QRegularExpressionMatch &other) Q_DECL_NOTHROW { d.swap(other.d); }
|
||||||
|
|
||||||
QRegularExpression regularExpression() const;
|
QRegularExpression regularExpression() const;
|
||||||
QRegularExpression::MatchType matchType() const;
|
QRegularExpression::MatchType matchType() const;
|
||||||
@ -226,10 +226,10 @@ public:
|
|||||||
QRegularExpressionMatchIterator(const QRegularExpressionMatchIterator &iterator);
|
QRegularExpressionMatchIterator(const QRegularExpressionMatchIterator &iterator);
|
||||||
QRegularExpressionMatchIterator &operator=(const QRegularExpressionMatchIterator &iterator);
|
QRegularExpressionMatchIterator &operator=(const QRegularExpressionMatchIterator &iterator);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator)
|
QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator) Q_DECL_NOTHROW
|
||||||
{ d.swap(iterator.d); return *this; }
|
{ d.swap(iterator.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
void swap(QRegularExpressionMatchIterator &iterator) { d.swap(iterator.d); }
|
void swap(QRegularExpressionMatchIterator &other) Q_DECL_NOTHROW { d.swap(other.d); }
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ public:
|
|||||||
inline QSharedDataPointer() { d = 0; }
|
inline QSharedDataPointer() { d = 0; }
|
||||||
inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
|
inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
|
||||||
|
|
||||||
explicit QSharedDataPointer(T *data);
|
explicit QSharedDataPointer(T *data) Q_DECL_NOTHROW;
|
||||||
inline QSharedDataPointer(const QSharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
|
inline QSharedDataPointer(const QSharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
|
||||||
inline QSharedDataPointer<T> & operator=(const QSharedDataPointer<T> &o) {
|
inline QSharedDataPointer<T> & operator=(const QSharedDataPointer<T> &o) {
|
||||||
if (o.d != d) {
|
if (o.d != d) {
|
||||||
@ -104,14 +104,14 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
QSharedDataPointer(QSharedDataPointer &&o) : d(o.d) { o.d = 0; }
|
QSharedDataPointer(QSharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = Q_NULLPTR; }
|
||||||
inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other)
|
inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline bool operator!() const { return !d; }
|
inline bool operator!() const { return !d; }
|
||||||
|
|
||||||
inline void swap(QSharedDataPointer &other)
|
inline void swap(QSharedDataPointer &other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); }
|
{ qSwap(d, other.d); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -155,7 +155,7 @@ public:
|
|||||||
inline QExplicitlySharedDataPointer() { d = 0; }
|
inline QExplicitlySharedDataPointer() { d = 0; }
|
||||||
inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
|
inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
|
||||||
|
|
||||||
explicit QExplicitlySharedDataPointer(T *data);
|
explicit QExplicitlySharedDataPointer(T *data) Q_DECL_NOTHROW;
|
||||||
inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
|
inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
|
||||||
|
|
||||||
template<class X>
|
template<class X>
|
||||||
@ -193,14 +193,14 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) : d(o.d) { o.d = 0; }
|
inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = Q_NULLPTR; }
|
||||||
inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other)
|
inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline bool operator!() const { return !d; }
|
inline bool operator!() const { return !d; }
|
||||||
|
|
||||||
inline void swap(QExplicitlySharedDataPointer &other)
|
inline void swap(QExplicitlySharedDataPointer &other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); }
|
{ qSwap(d, other.d); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -213,7 +213,8 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
Q_INLINE_TEMPLATE QSharedDataPointer<T>::QSharedDataPointer(T *adata) : d(adata)
|
Q_INLINE_TEMPLATE QSharedDataPointer<T>::QSharedDataPointer(T *adata) Q_DECL_NOTHROW
|
||||||
|
: d(adata)
|
||||||
{ if (d) d->ref.ref(); }
|
{ if (d) d->ref.ref(); }
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@ -249,7 +250,8 @@ Q_OUTOFLINE_TEMPLATE void QExplicitlySharedDataPointer<T>::detach_helper()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
Q_INLINE_TEMPLATE QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) : d(adata)
|
Q_INLINE_TEMPLATE QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) Q_DECL_NOTHROW
|
||||||
|
: d(adata)
|
||||||
{ if (d) d->ref.ref(); }
|
{ if (d) d->ref.ref(); }
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@ -273,12 +275,12 @@ namespace std {
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
Q_INLINE_TEMPLATE uint qHash(const QSharedDataPointer<T> &ptr, uint seed = 0)
|
Q_INLINE_TEMPLATE uint qHash(const QSharedDataPointer<T> &ptr, uint seed = 0) Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
return qHash(ptr.data(), seed);
|
return qHash(ptr.data(), seed);
|
||||||
}
|
}
|
||||||
template <class T>
|
template <class T>
|
||||||
Q_INLINE_TEMPLATE uint qHash(const QExplicitlySharedDataPointer<T> &ptr, uint seed = 0)
|
Q_INLINE_TEMPLATE uint qHash(const QExplicitlySharedDataPointer<T> &ptr, uint seed = 0) Q_DECL_NOTHROW
|
||||||
{
|
{
|
||||||
return qHash(ptr.data(), seed);
|
return qHash(ptr.data(), seed);
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ class Q_CORE_EXPORT QString
|
|||||||
public:
|
public:
|
||||||
typedef QStringData Data;
|
typedef QStringData Data;
|
||||||
|
|
||||||
inline QString();
|
inline QString() Q_DECL_NOTHROW;
|
||||||
explicit QString(const QChar *unicode, int size = -1);
|
explicit QString(const QChar *unicode, int size = -1);
|
||||||
QString(QChar c);
|
QString(QChar c);
|
||||||
QString(int size, QChar c);
|
QString(int size, QChar c);
|
||||||
@ -221,11 +221,11 @@ public:
|
|||||||
QString &operator=(const QString &);
|
QString &operator=(const QString &);
|
||||||
inline QString &operator=(QLatin1String latin1);
|
inline QString &operator=(QLatin1String latin1);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QString(QString && other) : d(other.d) { other.d = Data::sharedNull(); }
|
inline QString(QString && other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
|
||||||
inline QString &operator=(QString &&other)
|
inline QString &operator=(QString &&other) Q_DECL_NOTHROW
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
inline void swap(QString &other) { qSwap(d, other.d); }
|
inline void swap(QString &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
|
||||||
inline int size() const { return d->size; }
|
inline int size() const { return d->size; }
|
||||||
inline int count() const { return d->size; }
|
inline int count() const { return d->size; }
|
||||||
inline int length() const;
|
inline int length() const;
|
||||||
@ -1040,7 +1040,7 @@ inline void QCharRef::setRow(uchar arow) { QChar(*this).setRow(arow); }
|
|||||||
inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); }
|
inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); }
|
||||||
|
|
||||||
|
|
||||||
inline QString::QString() : d(Data::sharedNull()) {}
|
inline QString::QString() Q_DECL_NOTHROW : d(Data::sharedNull()) {}
|
||||||
inline QString::~QString() { if (!d->ref.deref()) Data::deallocate(d); }
|
inline QString::~QString() { if (!d->ref.deref()) Data::deallocate(d); }
|
||||||
|
|
||||||
inline void QString::reserve(int asize)
|
inline void QString::reserve(int asize)
|
||||||
|
@ -90,11 +90,11 @@ class QStringList : public QList<QString>
|
|||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
public:
|
public:
|
||||||
inline QStringList() { }
|
inline QStringList() Q_DECL_NOTHROW { }
|
||||||
inline explicit QStringList(const QString &i) { append(i); }
|
inline explicit QStringList(const QString &i) { append(i); }
|
||||||
inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
|
inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QStringList(QList<QString> &&l) : QList<QString>(std::move(l)) { }
|
inline QStringList(QList<QString> &&l) Q_DECL_NOTHROW : QList<QString>(std::move(l)) { }
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
||||||
inline QStringList(std::initializer_list<QString> args) : QList<QString>(args) { }
|
inline QStringList(std::initializer_list<QString> args) : QList<QString>(args) { }
|
||||||
@ -103,7 +103,7 @@ public:
|
|||||||
QStringList &operator=(const QList<QString> &other)
|
QStringList &operator=(const QList<QString> &other)
|
||||||
{ QList<QString>::operator=(other); return *this; }
|
{ QList<QString>::operator=(other); return *this; }
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
QStringList &operator=(QList<QString> &&other)
|
QStringList &operator=(QList<QString> &&other) Q_DECL_NOTHROW
|
||||||
{ QList<QString>::operator=(std::move(other)); return *this; }
|
{ QList<QString>::operator=(std::move(other)); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -79,10 +79,10 @@ public:
|
|||||||
|
|
||||||
QTimeZone &operator=(const QTimeZone &other);
|
QTimeZone &operator=(const QTimeZone &other);
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
QTimeZone &operator=(QTimeZone &&other) { swap(other); return *this; }
|
QTimeZone &operator=(QTimeZone &&other) Q_DECL_NOTHROW { swap(other); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void swap(QTimeZone &other)
|
void swap(QTimeZone &other) Q_DECL_NOTHROW
|
||||||
{ d.swap(other.d); }
|
{ d.swap(other.d); }
|
||||||
|
|
||||||
bool operator==(const QTimeZone &other) const;
|
bool operator==(const QTimeZone &other) const;
|
||||||
|
@ -61,7 +61,7 @@ class QVector
|
|||||||
Data *d;
|
Data *d;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline QVector() : d(Data::sharedNull()) { }
|
inline QVector() Q_DECL_NOTHROW : d(Data::sharedNull()) { }
|
||||||
explicit QVector(int size);
|
explicit QVector(int size);
|
||||||
QVector(int size, const T &t);
|
QVector(int size, const T &t);
|
||||||
inline QVector(const QVector<T> &v);
|
inline QVector(const QVector<T> &v);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user