Bump project requirement to C++17

This commit is contained in:
Chocobo1
2020-12-19 14:52:01 +08:00
parent a579b4a519
commit d70b893852
19 changed files with 101 additions and 139 deletions

View File

@@ -30,5 +30,4 @@
#include <QString>
// TODO: Make it inline in C++17
extern const QString QB_EXT;
inline const QString QB_EXT {QStringLiteral(".!qB")};

View File

@@ -30,9 +30,6 @@
#include <type_traits>
template <typename ...>
using void_t = void; // replace this with std::void_t in C++17
template <typename T, typename = void>
struct HasUnderlyingType
: std::false_type
@@ -40,7 +37,7 @@ struct HasUnderlyingType
};
template <typename T>
struct HasUnderlyingType<T, void_t<typename T::underlying_type>>
struct HasUnderlyingType<T, std::void_t<typename T::underlying_type>>
: std::true_type
{
};

View File

@@ -291,9 +291,8 @@ namespace
LowerLimited<T> lowerLimited(T limit, T ret) { return LowerLimited<T>(limit, ret); }
template <typename T>
std::function<T (const T&)> clampValue(const T lower, const T upper)
auto clampValue(const T lower, const T upper)
{
// TODO: change return type to `auto` when using C++17
return [lower, upper](const T value) -> T
{
if (value < lower)

View File

@@ -69,8 +69,6 @@
#include "session.h"
#include "trackerentry.h"
const QString QB_EXT {QStringLiteral(".!qB")};
using namespace BitTorrent;
namespace