mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
Bump project requirement to C++17
This commit is contained in:
@@ -60,18 +60,3 @@ Utils::IO::FileDeviceOutputIterator &Utils::IO::FileDeviceOutputIterator::operat
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Utils::IO::FileDeviceOutputIterator &Utils::IO::FileDeviceOutputIterator::operator*()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
Utils::IO::FileDeviceOutputIterator &Utils::IO::FileDeviceOutputIterator::operator++()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
Utils::IO::FileDeviceOutputIterator &Utils::IO::FileDeviceOutputIterator::operator++(int)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -49,10 +49,21 @@ namespace Utils
|
||||
|
||||
// mimic std::ostream_iterator behavior
|
||||
FileDeviceOutputIterator &operator=(char c);
|
||||
// TODO: make these `constexpr` in C++17
|
||||
FileDeviceOutputIterator &operator*();
|
||||
FileDeviceOutputIterator &operator++();
|
||||
FileDeviceOutputIterator &operator++(int);
|
||||
|
||||
constexpr FileDeviceOutputIterator &operator*()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr FileDeviceOutputIterator &operator++()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr FileDeviceOutputIterator &operator++(int)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
QFileDevice *m_device;
|
||||
|
||||
@@ -73,20 +73,20 @@ namespace Utils
|
||||
|
||||
QString join(const QVector<QStringRef> &strings, const QString &separator);
|
||||
|
||||
template <typename T, typename std::enable_if_t<std::is_enum<T>::value, int> = 0>
|
||||
template <typename T, typename std::enable_if_t<std::is_enum_v<T>, int> = 0>
|
||||
QString fromEnum(const T &value)
|
||||
{
|
||||
static_assert(std::is_same<int, typename std::underlying_type_t<T>>::value,
|
||||
static_assert(std::is_same_v<int, typename std::underlying_type_t<T>>,
|
||||
"Enumeration underlying type has to be int.");
|
||||
|
||||
const auto metaEnum = QMetaEnum::fromType<T>();
|
||||
return QString::fromLatin1(metaEnum.valueToKey(static_cast<int>(value)));
|
||||
}
|
||||
|
||||
template <typename T, typename std::enable_if_t<std::is_enum<T>::value, int> = 0>
|
||||
template <typename T, typename std::enable_if_t<std::is_enum_v<T>, int> = 0>
|
||||
T toEnum(const QString &serializedValue, const T &defaultValue)
|
||||
{
|
||||
static_assert(std::is_same<int, typename std::underlying_type_t<T>>::value,
|
||||
static_assert(std::is_same_v<int, typename std::underlying_type_t<T>>,
|
||||
"Enumeration underlying type has to be int.");
|
||||
|
||||
const auto metaEnum = QMetaEnum::fromType<T>();
|
||||
|
||||
Reference in New Issue
Block a user