aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-10-02 11:36:54 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-10-02 11:36:54 +0900
commita2badac44d94294d9404224a55b3193c87cc201d (patch)
tree9c4ffea8954050c32fbcd577f065f5ad58625370 /lib/jobs
parent1a1093b849df33baa5cee246d71e6ba63730c52f (diff)
downloadlibquotient-a2badac44d94294d9404224a55b3193c87cc201d.tar.gz
libquotient-a2badac44d94294d9404224a55b3193c87cc201d.zip
More fixes for Apple not having deduction guides in stdlib
Diffstat (limited to 'lib/jobs')
-rw-r--r--lib/jobs/basejob.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index 6a70bc40..7336fc47 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -44,6 +44,12 @@ struct NetworkReplyDeleter : public QScopedPointerDeleteLater {
}
};
+template <typename... Ts>
+constexpr auto make_array(Ts&&... items)
+{
+ return std::array<std::common_type_t<Ts...>, sizeof...(Ts)>({items...});
+}
+
class BaseJob::Private {
public:
struct JobTimeoutConfig {
@@ -108,10 +114,10 @@ public:
QString dumpRequest() const
{
- // Thanks to C++17, std::array's type and bounds are deduced
+ // FIXME: use std::array {} when Apple stdlib gets deduction guides for it
static const auto verbs =
- std::array { QStringLiteral("GET"), QStringLiteral("PUT"),
- QStringLiteral("POST"), QStringLiteral("DELETE") };
+ make_array(QStringLiteral("GET"), QStringLiteral("PUT"),
+ QStringLiteral("POST"), QStringLiteral("DELETE"));
const auto verbWord = verbs.at(size_t(verb));
return verbWord % ' '
% (reply ? reply->url().toString(QUrl::RemoveQuery)