aboutsummaryrefslogtreecommitdiff
path: root/lib/util.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-08-23 10:28:59 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-08-23 10:29:17 +0200
commitd7820ada21fb29b273a68a5ea69477ef5763d5de (patch)
tree9cbe806eb6a9ffe90eae429cfb8f1ee7cf9ea6c5 /lib/util.cpp
parent1cf07ee56315af86cadccc977948e9ed1d51da1a (diff)
downloadlibquotient-d7820ada21fb29b273a68a5ea69477ef5763d5de.tar.gz
libquotient-d7820ada21fb29b273a68a5ea69477ef5763d5de.zip
More cleanup; drop Qt bearer management on Qt 5.15+
Qt 5.15 deprecates bearer management.
Diffstat (limited to 'lib/util.cpp')
-rw-r--r--lib/util.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/lib/util.cpp b/lib/util.cpp
index 61661de8..797f6d69 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -126,32 +126,30 @@ QString Quotient::serverPart(const QString& mxId)
% ServerPartRegEx % ")$";
static QRegularExpression parser(
re,
- QRegularExpression::UseUnicodePropertiesOption); // Because Asian
- // digits
+ QRegularExpression::UseUnicodePropertiesOption); // Because Asian digits
return parser.match(mxId).captured(1);
}
// Tests for function_traits<>
-#ifdef Q_CC_CLANG
-# pragma clang diagnostic push
-# pragma ide diagnostic ignored "OCSimplifyInspection"
-#endif
using namespace Quotient;
-int f();
-static_assert(std::is_same<fn_return_t<decltype(f)>, int>::value,
+int f_();
+static_assert(std::is_same<fn_return_t<decltype(f_)>, int>::value,
"Test fn_return_t<>");
-void f1(int, QString);
-static_assert(std::is_same<fn_arg_t<decltype(f1), 1>, QString>::value,
+void f1_(int, QString);
+static_assert(std::is_same<fn_arg_t<decltype(f1_), 1>, QString>::value,
"Test fn_arg_t<>");
struct Fo {
int operator()();
+ static constexpr auto l = [] { return 0.0f; };
};
static_assert(std::is_same<fn_return_t<Fo>, int>::value,
"Test return type of function object");
+static_assert(std::is_same<fn_return_t<decltype(Fo::l)>, float>::value,
+ "Test return type of lambda");
struct Fo1 {
void operator()(int);
@@ -159,20 +157,10 @@ struct Fo1 {
static_assert(std::is_same<fn_arg_t<Fo1>, int>(),
"Test fn_arg_t defaulting to first argument");
-#if (!defined(_MSC_VER) || _MSC_VER >= 1910)
-static auto l = [] { return 1; };
-static_assert(std::is_same<fn_return_t<decltype(l)>, int>::value,
- "Test fn_return_t<> with lambda");
-#endif
-
template <typename T>
-QString ft(T&&)
+static QString ft(T&&)
{
return {};
}
static_assert(std::is_same<fn_arg_t<decltype(ft<QString>)>, QString&&>(),
"Test function templates");
-
-#ifdef Q_CC_CLANG
-# pragma clang diagnostic pop
-#endif