diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/jobs/basejob.cpp | 12 |
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) |