From 8d7c97d428cdf89c3419a4e13b62a9849feefce9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 4 Apr 2019 16:46:41 +0200 Subject: Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usage Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira --- src/corelib/tools/qpair.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/corelib/tools/qpair.h') diff --git a/src/corelib/tools/qpair.h b/src/corelib/tools/qpair.h index 1af43d0a68..6d1e67efb7 100644 --- a/src/corelib/tools/qpair.h +++ b/src/corelib/tools/qpair.h @@ -52,41 +52,41 @@ struct QPair typedef T2 second_type; Q_DECL_CONSTEXPR QPair() - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_default_constructible::value && + noexcept((std::is_nothrow_default_constructible::value && std::is_nothrow_default_constructible::value)) : first(), second() {} Q_DECL_CONSTEXPR QPair(const T1 &t1, const T2 &t2) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_copy_constructible::value && + noexcept((std::is_nothrow_copy_constructible::value && std::is_nothrow_copy_constructible::value)) : first(t1), second(t2) {} // compiler-generated copy/move ctor/assignment operators are fine! template Q_DECL_CONSTEXPR QPair(const QPair &p) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_constructible::value && + noexcept((std::is_nothrow_constructible::value && std::is_nothrow_constructible::value)) : first(p.first), second(p.second) {} template Q_DECL_RELAXED_CONSTEXPR QPair &operator=(const QPair &p) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_assignable::value && + noexcept((std::is_nothrow_assignable::value && std::is_nothrow_assignable::value)) { first = p.first; second = p.second; return *this; } #ifdef Q_COMPILER_RVALUE_REFS template Q_DECL_CONSTEXPR QPair(QPair &&p) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_constructible::value && + noexcept((std::is_nothrow_constructible::value && std::is_nothrow_constructible::value)) // can't use std::move here as it's not constexpr in C++11: : first(static_cast(p.first)), second(static_cast(p.second)) {} template Q_DECL_RELAXED_CONSTEXPR QPair &operator=(QPair &&p) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_assignable::value && + noexcept((std::is_nothrow_assignable::value && std::is_nothrow_assignable::value)) { first = std::move(p.first); second = std::move(p.second); return *this; } #endif Q_DECL_RELAXED_CONSTEXPR void swap(QPair &other) - Q_DECL_NOEXCEPT_EXPR(noexcept(qSwap(other.first, other.first)) && noexcept(qSwap(other.second, other.second))) + noexcept(noexcept(qSwap(other.first, other.first)) && noexcept(qSwap(other.second, other.second))) { // use qSwap() to pick up ADL swaps automatically: qSwap(first, other.first); @@ -103,7 +103,7 @@ QPair(T1, T2) -> QPair; #endif template -void swap(QPair &lhs, QPair &rhs) Q_DECL_NOEXCEPT_EXPR(noexcept(lhs.swap(rhs))) +void swap(QPair &lhs, QPair &rhs) noexcept(noexcept(lhs.swap(rhs))) { lhs.swap(rhs); } // mark QPair as complex/movable/primitive depending on the @@ -113,45 +113,45 @@ class QTypeInfo > : public QTypeInfoMerger, T1, T2> template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator==(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(p1.first == p2.first && p1.second == p2.second)) + noexcept(noexcept(p1.first == p2.first && p1.second == p2.second)) { return p1.first == p2.first && p1.second == p2.second; } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator!=(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(!(p1 == p2))) + noexcept(noexcept(!(p1 == p2))) { return !(p1 == p2); } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator<(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second))) + noexcept(noexcept(p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second))) { return p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second); } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator>(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(p2 < p1)) + noexcept(noexcept(p2 < p1)) { return p2 < p1; } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator<=(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(!(p2 < p1))) + noexcept(noexcept(!(p2 < p1))) { return !(p2 < p1); } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator>=(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(!(p1 < p2))) + noexcept(noexcept(!(p1 < p2))) { return !(p1 < p2); } template Q_DECL_CONSTEXPR Q_OUTOFLINE_TEMPLATE QPair qMakePair(const T1 &x, const T2 &y) - Q_DECL_NOEXCEPT_EXPR(noexcept(QPair(x, y))) + noexcept(noexcept(QPair(x, y))) { return QPair(x, y); } -- cgit v1.2.3