diff --git a/src/blackgui/models/listmodeldbobjects.cpp b/src/blackgui/models/listmodeldbobjects.cpp index 9a2cfbfd4..db5507a4e 100644 --- a/src/blackgui/models/listmodeldbobjects.cpp +++ b/src/blackgui/models/listmodeldbobjects.cpp @@ -43,8 +43,8 @@ namespace BlackGui { CListModelBaseNonTemplate::m_sortTieBreakers.push_front(ObjectType::keyIndex()); - constexpr bool hasIntegerKey = std::is_base_of::value && std::is_same::value; - constexpr bool hasStringKey = std::is_base_of::value && std::is_base_of::value; + constexpr bool hasIntegerKey = std::is_base_of_v && std::is_same_v; + constexpr bool hasStringKey = std::is_base_of_v && std::is_base_of_v; static_assert(hasIntegerKey || hasStringKey, "ObjectType needs to implement IDatastoreObjectWithXXXXKey and have appropriate KeyType"); } diff --git a/src/blackmisc/algorithm.h b/src/blackmisc/algorithm.h index 5c18be696..cbcc7dd15 100644 --- a/src/blackmisc/algorithm.h +++ b/src/blackmisc/algorithm.h @@ -176,7 +176,7 @@ namespace BlackMisc template void tupleForEachPair(T &&tuple, F &&visitor) { - using seq = std::make_index_sequence>::value / 2>; + using seq = std::make_index_sequence> / 2>; return Private::tupleForEachPairImpl(std::forward(tuple), std::forward(visitor), seq()); } } diff --git a/src/blackmisc/atomicfile.cpp b/src/blackmisc/atomicfile.cpp index 3935f93af..479d27312 100644 --- a/src/blackmisc/atomicfile.cpp +++ b/src/blackmisc/atomicfile.cpp @@ -134,7 +134,7 @@ namespace BlackMisc char s[1024] {}; auto x = strerror_r(errno, s, sizeof(s)); setErrorString(QString::fromLocal8Bit(s)); - static_assert(std::is_same::value, "Non-standard signature of POSIX function strerror_r, check documentation."); + static_assert(std::is_same_v, "Non-standard signature of POSIX function strerror_r, check documentation."); } } #elif defined(Q_OS_WIN32) diff --git a/src/blackmisc/aviation/modulator.cpp b/src/blackmisc/aviation/modulator.cpp index 147ba9f20..47dd314a6 100644 --- a/src/blackmisc/aviation/modulator.cpp +++ b/src/blackmisc/aviation/modulator.cpp @@ -173,14 +173,14 @@ namespace BlackMisc template CModulator::CModulator() : m_name("default") { - static_assert(!std::is_polymorphic::value, "Must not use virtual functions for value classes"); + static_assert(!std::is_polymorphic_v, "Must not use virtual functions for value classes"); } template CModulator::CModulator(const QString &name, const BlackMisc::PhysicalQuantities::CFrequency &activeFrequency, const BlackMisc::PhysicalQuantities::CFrequency &standbyFrequency) : m_name(name), m_frequencyActive(activeFrequency), m_frequencyStandby(standbyFrequency) { - static_assert(!std::is_polymorphic::value, "Must not use virtual functions for value classes"); + static_assert(!std::is_polymorphic_v, "Must not use virtual functions for value classes"); } template diff --git a/src/blackmisc/comparefunctions.h b/src/blackmisc/comparefunctions.h index 5a0ad892c..b3b81f07d 100644 --- a/src/blackmisc/comparefunctions.h +++ b/src/blackmisc/comparefunctions.h @@ -20,7 +20,7 @@ namespace BlackMisc namespace Compare { //! Compare arithmetic values - template ::value, int> = 0> + template , int> = 0> int compare(T a, T b) { if (a < b) { return -1; } @@ -29,7 +29,7 @@ namespace BlackMisc } //! Compare enumerators - template ::value, int> = 0> + template , int> = 0> int compare(T a, T b) { using UT = std::underlying_type_t; diff --git a/src/blackmisc/db/datastoreobjectlist.h b/src/blackmisc/db/datastoreobjectlist.h index 67658dbce..477ded9a5 100644 --- a/src/blackmisc/db/datastoreobjectlist.h +++ b/src/blackmisc/db/datastoreobjectlist.h @@ -27,8 +27,8 @@ namespace BlackMisc //! Such objects should implement \sa ITimestampBased and \sa IDatastoreObjectWithIntegerKey or \sa IDatastoreObjectWithStringKey template class IDatastoreObjectList : public ITimestampObjectList { - static constexpr bool hasIntegerKey = std::is_base_of::value && std::is_same::value; - static constexpr bool hasStringKey = std::is_base_of::value && std::is_base_of::value; + static constexpr bool hasIntegerKey = std::is_base_of_v && std::is_same_v; + static constexpr bool hasStringKey = std::is_base_of_v && std::is_base_of_v; static_assert(hasIntegerKey || hasStringKey, "ObjectType needs to implement IDatastoreObjectWithXXXXKey and have appropriate KeyType"); public: diff --git a/src/blackmisc/dbus.h b/src/blackmisc/dbus.h index 6aa8aa38c..787490657 100644 --- a/src/blackmisc/dbus.h +++ b/src/blackmisc/dbus.h @@ -33,7 +33,7 @@ const QDBusArgument &operator >>(const QDBusArgument &arg, std::string &s); /*! * Operator for streaming enums to QDBusArgument. */ -template ::value, int> = 0> +template , int> = 0> QDBusArgument &operator <<(QDBusArgument &arg, const E &value) { arg.beginStructure(); @@ -45,7 +45,7 @@ QDBusArgument &operator <<(QDBusArgument &arg, const E &value) /*! * Operator for streaming enums from QDBusArgument. */ -template ::value, int> = 0> +template , int> = 0> const QDBusArgument &operator >>(const QDBusArgument &arg, E &value) { int temp; diff --git a/src/blackmisc/dictionary.h b/src/blackmisc/dictionary.h index 428fec411..79706a5ea 100644 --- a/src/blackmisc/dictionary.h +++ b/src/blackmisc/dictionary.h @@ -63,7 +63,7 @@ namespace BlackMisc struct TAssociativityTraits { template - struct DefaultType { static_assert(std::is_void::value, "Key does not support either QHash or QMap"); }; + struct DefaultType { static_assert(std::is_void_v, "Key does not support either QHash or QMap"); }; }; //! \endcond } @@ -475,7 +475,7 @@ namespace BlackMisc template void forEachIntersection(const Map1 &map1, const Map2 &map2, F functor) { - static_assert(std::is_same::value, "Maps must have the same key type"); + static_assert(std::is_same_v, "Maps must have the same key type"); if (map1.empty() || map2.empty()) { return; } auto it1 = implementationOf(map1).lowerBound(map2.cbegin().key()); auto end1 = implementationOf(map1).upperBound((map2.cend() - 1).key()); diff --git a/src/blackmisc/eventloop.h b/src/blackmisc/eventloop.h index d34060c65..65117af44 100644 --- a/src/blackmisc/eventloop.h +++ b/src/blackmisc/eventloop.h @@ -71,14 +71,14 @@ namespace BlackMisc private: template - static bool checkInit(F init, std::enable_if_t::value, int> = 0) + static bool checkInit(F init, std::enable_if_t, int> = 0) { init(); return false; } template - static bool checkInit(F init, std::enable_if_t::value, int> = 0) + static bool checkInit(F init, std::enable_if_t, int> = 0) { return init(); } diff --git a/src/blackmisc/invoke.h b/src/blackmisc/invoke.h index 6551d4240..be5a6bc23 100644 --- a/src/blackmisc/invoke.h +++ b/src/blackmisc/invoke.h @@ -27,17 +27,17 @@ namespace BlackMisc { // Our own version of C++17 std::invoke(). - template ::value>> + template >> decltype(auto) invoke(F ptr, T && object) { return std::forward(object).*ptr; } - template ::value>> + template >> decltype(auto) invoke(F ptr, T && object, Ts && ... args) { return (std::forward(object).*ptr)(std::forward(args)...); } - template < typename F, typename... Ts, typename = std::enable_if_t < ! std::is_member_pointer>::value >> + template < typename F, typename... Ts, typename = std::enable_if_t < ! std::is_member_pointer_v>>> decltype(auto) invoke(F && func, Ts && ... args) { return std::forward(func)(std::forward(args)...); diff --git a/src/blackmisc/iterator.h b/src/blackmisc/iterator.h index a6d9b7126..8d7808788 100644 --- a/src/blackmisc/iterator.h +++ b/src/blackmisc/iterator.h @@ -55,7 +55,7 @@ namespace BlackMisc OutputIterator &operator *() { return *this; } //! Assignment operator performs the output - template ::value, int> = 0> + template , int> = 0> OutputIterator &operator =(T &&value) { m_func(std::forward(value)); return *this; } //! Copy assignment operator @@ -135,7 +135,7 @@ namespace BlackMisc }; //! The type returned by this iterator's arrow operator, which may be a pointer or a pointer-like wrapper object - using pointer = typename std::conditional::value, + using pointer = typename std::conditional, std::remove_reference_t *, PointerWrapper>::type; diff --git a/src/blackmisc/json.h b/src/blackmisc/json.h index 67385612d..a8a2ff72d 100644 --- a/src/blackmisc/json.h +++ b/src/blackmisc/json.h @@ -73,14 +73,14 @@ BLACKMISC_EXPORT QJsonValueRef operator >>(QJsonValueRef json, QByteArray &value //! \ingroup JSON //! @{ template -std::enable_if_t::value, QJsonObject> +std::enable_if_t, QJsonObject> &operator<<(QJsonObject &json, std::pair value) { json.insert(value.first, QJsonValue(static_cast(value.second))); return json; } template -std::enable_if_t::value, QJsonObject> +std::enable_if_t, QJsonObject> &operator<<(QJsonObject &json, std::pair value) { json[value.first] = QJsonValue(static_cast(value.second)); @@ -108,7 +108,7 @@ QJsonObject &operator<<(QJsonObject &json, std::pair -std::enable_if_t::value, QJsonValue> +std::enable_if_t, QJsonValue> const &operator>>(const QJsonValue &json, ENUM &value) { value = static_cast(json.toInt()); @@ -126,7 +126,7 @@ const QJsonValue &operator>>(const QJsonValue &json, QFlags &value) //! \brief Specialized JSON deserialization for enum //! \ingroup JSON -template::value>> +template>> QJsonValueRef operator>>(QJsonValueRef json, ENUM &value) { value = static_cast(json.toInt()); diff --git a/src/blackmisc/lockfree.h b/src/blackmisc/lockfree.h index f95ed2c8f..3fd6640d5 100644 --- a/src/blackmisc/lockfree.h +++ b/src/blackmisc/lockfree.h @@ -82,7 +82,7 @@ namespace BlackMisc LockFreeUniqueWriter &operator =(const T &other) { *m_ptr = other; return *this; } //! Replace the stored value by moving from a T. The change is applied in the destructor. - LockFreeUniqueWriter &operator =(T &&other) noexcept(std::is_nothrow_move_assignable::value) { *m_ptr = std::move(other); return *this; } + LockFreeUniqueWriter &operator =(T &&other) noexcept(std::is_nothrow_move_assignable_v) { *m_ptr = std::move(other); return *this; } //! LockFreeUniqueWriter cannot be copied. //! @{ @@ -137,7 +137,7 @@ namespace BlackMisc LockFreeSharedWriter &operator =(const T &other) { *m_ptr = other; return *this; } //! Replace the stored value by moving from a T. The change is applied by evaluating in a bool context. - LockFreeSharedWriter &operator =(T &&other) noexcept(std::is_nothrow_move_assignable::value) { *m_ptr = std::move(other); return *this; } + LockFreeSharedWriter &operator =(T &&other) noexcept(std::is_nothrow_move_assignable_v) { *m_ptr = std::move(other); return *this; } //! Try to overwrite the original object with the new one stored in the writer, and return false on success. //! If true is returned, then the caller must try again. This would happen if another simultaneous write had occurred. @@ -206,7 +206,7 @@ namespace BlackMisc LockFree(const T &other) : m_ptr(std::make_shared(other)) {} //! Construct by moving from a T. - LockFree(T &&other) noexcept(std::is_nothrow_move_assignable::value) : m_ptr(std::make_shared(std::move(other))) {} + LockFree(T &&other) noexcept(std::is_nothrow_move_assignable_v) : m_ptr(std::make_shared(std::move(other))) {} //! LockFree cannot be copied or moved. //! @{ diff --git a/src/blackmisc/logcategorylist.h b/src/blackmisc/logcategorylist.h index a39cfe285..b1f637c44 100644 --- a/src/blackmisc/logcategorylist.h +++ b/src/blackmisc/logcategorylist.h @@ -65,7 +65,7 @@ namespace BlackMisc * \param pointer The value of pointer is unimportant. Only the static type T is considered. * It is legal to pass static_cast(nullptr), but in member functions passing the this pointer is easier. */ - template ::value>> + template >> CLogCategoryList(const T *pointer) : CLogCategoryList(fromClass()) { Q_UNUSED(pointer); } //! Return a copy with another category appended. diff --git a/src/blackmisc/metaclass.h b/src/blackmisc/metaclass.h index d3205f499..baf36aa1a 100644 --- a/src/blackmisc/metaclass.h +++ b/src/blackmisc/metaclass.h @@ -251,7 +251,7 @@ namespace BlackMisc template constexpr static CMetaMember makeMetaMember(M ptrToMember, const char *name = nullptr, int index = 0, MetaFlags flags = {}) { - static_assert(std::is_member_object_pointer::value, "M must be a pointer to member object"); + static_assert(std::is_member_object_pointer_v, "M must be a pointer to member object"); return { ptrToMember, name, index, flags }; } }; diff --git a/src/blackmisc/mixin/mixinindex.h b/src/blackmisc/mixin/mixinindex.h index 8ae354c78..df4bed403 100644 --- a/src/blackmisc/mixin/mixinindex.h +++ b/src/blackmisc/mixin/mixinindex.h @@ -70,14 +70,14 @@ namespace BlackMisc const Derived *derived() const { return static_cast(this); } Derived *derived() { return static_cast(this); } - template ::value, int> = 0> + template , int> = 0> QVariant myself() const { return QVariant::fromValue(*derived()); } - template ::value, int> = 0> + template , int> = 0> void myself(const QVariant &variant) { *derived() = variant.value(); } - template ::value, int> = 0> + template , int> = 0> QVariant myself() const { qFatal("isMyself should have been handled before reaching here"); return {}; } - template ::value, int> = 0> + template , int> = 0> void myself(const QVariant &) { qFatal("isMyself should have been handled before reaching here"); } template diff --git a/src/blackmisc/optional.h b/src/blackmisc/optional.h index 80077ce37..d2934c93d 100644 --- a/src/blackmisc/optional.h +++ b/src/blackmisc/optional.h @@ -29,7 +29,7 @@ namespace BlackMisc Optional() noexcept {} //! Construct from a value. - Optional(T value) noexcept(std::is_nothrow_move_constructible::value) + Optional(T value) noexcept(std::is_nothrow_move_constructible_v) { new (m_data.bytes) T(std::move(value)); m_isValid = true; @@ -39,14 +39,14 @@ namespace BlackMisc Optional(std::nullptr_t) noexcept {} //! Copy constructor. - Optional(const Optional &other) noexcept(std::is_nothrow_copy_constructible::value) + Optional(const Optional &other) noexcept(std::is_nothrow_copy_constructible_v) { if (other.m_isValid) { new (m_data.bytes) T(*other); } m_isValid = other.m_isValid; } //! Move constructor. - Optional(Optional &&other) noexcept(std::is_nothrow_move_constructible::value) + Optional(Optional &&other) noexcept(std::is_nothrow_move_constructible_v) { if (other.m_isValid) { new (m_data.bytes) T(std::move(*other)); } m_isValid = other.m_isValid; @@ -60,7 +60,7 @@ namespace BlackMisc } //! Copy assignment. - Optional &operator =(const Optional &other) noexcept(std::is_nothrow_copy_constructible::value) + Optional &operator =(const Optional &other) noexcept(std::is_nothrow_copy_constructible_v) { reset(); if (other.m_isValid) { new (m_data.bytes) T(*other); } @@ -69,7 +69,7 @@ namespace BlackMisc } //! Move assignment. - Optional &operator =(Optional &&other) noexcept(std::is_nothrow_move_constructible::value) + Optional &operator =(Optional &&other) noexcept(std::is_nothrow_move_constructible_v) { reset(); if (other.m_isValid) { new (m_data.bytes) T(std::move(*other)); } diff --git a/src/blackmisc/orderablelist.h b/src/blackmisc/orderablelist.h index 26b55b0ee..46a9ae058 100644 --- a/src/blackmisc/orderablelist.h +++ b/src/blackmisc/orderablelist.h @@ -21,7 +21,7 @@ namespace BlackMisc template class IOrderableList { - static_assert(std::is_base_of::value, "OBJ needs to implement IOrderable"); + static_assert(std::is_base_of_v, "OBJ needs to implement IOrderable"); public: //! Sort ascending diff --git a/src/blackmisc/processinfo.cpp b/src/blackmisc/processinfo.cpp index ea0643416..79d6cb5e8 100644 --- a/src/blackmisc/processinfo.cpp +++ b/src/blackmisc/processinfo.cpp @@ -39,7 +39,7 @@ namespace BlackMisc QString CProcessInfo::processNameFromId(qint64 pid) { char name[1024]; - proc_name(pid, name, std::extent::value); + proc_name(pid, name, std::extent_v); return name; } #elif defined(Q_OS_WIN) @@ -48,7 +48,7 @@ namespace BlackMisc HANDLE proc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, static_cast(pid)); if (! proc) { return {}; } wchar_t path[1024]; - auto len = GetModuleFileNameEx(proc, nullptr, path, std::extent::value); + auto len = GetModuleFileNameEx(proc, nullptr, path, std::extent_v); CloseHandle(proc); if (len <= 0) { return {}; } return QFileInfo(QString::fromWCharArray(path)).completeBaseName(); diff --git a/src/blackmisc/propertyindex.h b/src/blackmisc/propertyindex.h index 153f59801..db61379d1 100644 --- a/src/blackmisc/propertyindex.h +++ b/src/blackmisc/propertyindex.h @@ -123,7 +123,7 @@ namespace BlackMisc //! Compare with index given by enum template bool contains(EnumType ev) const { - static_assert(std::is_enum::value, "Argument must be an enum"); + static_assert(std::is_enum_v, "Argument must be an enum"); return this->contains(static_cast(ev)); } @@ -136,14 +136,14 @@ namespace BlackMisc //! First element casted to given type, usually the PropertIndex enum template CastType frontCasted() const { - static_assert(std::is_enum::value || std::is_integral::value, "CastType must be an enum or integer"); + static_assert(std::is_enum_v || std::is_integral_v, "CastType must be an enum or integer"); return static_cast(frontToInt()); } //! Compare with index given by enum template bool startsWithPropertyIndexEnum(EnumType ev) const { - static_assert(std::is_enum::value, "Argument must be an enum"); + static_assert(std::is_enum_v, "Argument must be an enum"); return this->startsWith(static_cast(ev)); } diff --git a/src/blackmisc/propertyindexref.h b/src/blackmisc/propertyindexref.h index ac557c77f..6171cc70e 100644 --- a/src/blackmisc/propertyindexref.h +++ b/src/blackmisc/propertyindexref.h @@ -188,14 +188,14 @@ namespace BlackMisc //! First element casted to given type, usually the PropertIndex enum template CastType frontCasted() const { - static_assert(std::is_enum::value || std::is_integral::value, "CastType must be an enum or integer"); + static_assert(std::is_enum_v || std::is_integral_v, "CastType must be an enum or integer"); return static_cast(frontToInt()); } //! Compare with index given by enum template bool startsWithPropertyIndexEnum(EnumType ev) const { - static_assert(std::is_enum::value, "Argument must be an enum"); + static_assert(std::is_enum_v, "Argument must be an enum"); return this->startsWith(static_cast(ev)); } diff --git a/src/blackmisc/propertyindexvariantmap.h b/src/blackmisc/propertyindexvariantmap.h index 687d2f58e..6a8c39214 100644 --- a/src/blackmisc/propertyindexvariantmap.h +++ b/src/blackmisc/propertyindexvariantmap.h @@ -108,7 +108,7 @@ namespace BlackMisc bool matchesVariant(const CVariant &value) const; //! True if this map matches the value - template ::value>> + template >> bool matches(const T &value) const { return matchesVariant(CVariant::from(value)); } //! Map diff --git a/src/blackmisc/range.h b/src/blackmisc/range.h index fa73386b5..0c5772066 100644 --- a/src/blackmisc/range.h +++ b/src/blackmisc/range.h @@ -213,12 +213,12 @@ namespace BlackMisc //! Create a range from reverse iterators. CRange reverse() const { - static_assert(std::is_same::value, "see https://dev.swift-project.org/T700"); + static_assert(std::is_same_v, "see https://dev.swift-project.org/T700"); return { rbegin(), rend() }; } //! Implicit conversion to any container of value_type which supports push_back. This will copy elements. - template ::value>> + template >> operator T() const { return to(); diff --git a/src/blackmisc/sharedstate/listobserver.h b/src/blackmisc/sharedstate/listobserver.h index 1b0aeb693..8f0fd24a2 100644 --- a/src/blackmisc/sharedstate/listobserver.h +++ b/src/blackmisc/sharedstate/listobserver.h @@ -76,7 +76,7 @@ namespace BlackMisc virtual void initialize(IDataLink *dataLink) override { CGenericListObserver::initialize(dataLink); - if (std::is_same::value) { setFilter({}); } + if (std::is_same_v) { setFilter({}); } } //! Set filter to choose list elements. diff --git a/src/blackmisc/slot.h b/src/blackmisc/slot.h index 4126a86a4..5752d1f17 100644 --- a/src/blackmisc/slot.h +++ b/src/blackmisc/slot.h @@ -51,7 +51,7 @@ namespace BlackMisc template QMetaObject::Connection connectOnce(T *sender, F signal, G &&slot) { - static_assert(! std::is_member_pointer>::value, "If slot is a pointer to member, a receiver must be supplied"); + static_assert(! std::is_member_pointer_v>, "If slot is a pointer to member, a receiver must be supplied"); return connectOnce(sender, signal, sender, std::forward(slot)); } diff --git a/src/blackmisc/stringutils.h b/src/blackmisc/stringutils.h index 2a884a600..bd8599994 100644 --- a/src/blackmisc/stringutils.h +++ b/src/blackmisc/stringutils.h @@ -382,11 +382,11 @@ namespace BlackMisc { static QString toQString(double n) { return QString::number(n); } }; - template struct TString::value>> + template struct TString>> { static QString toQString(T e) { return QString::number(e); } }; - template struct TString::value>> + template struct TString>> { static QString toQString(const T &v) { return v; } }; diff --git a/src/blackmisc/timestampobjectlist.h b/src/blackmisc/timestampobjectlist.h index 6df815309..dacf049cb 100644 --- a/src/blackmisc/timestampobjectlist.h +++ b/src/blackmisc/timestampobjectlist.h @@ -44,7 +44,7 @@ namespace BlackMisc //! Such objects should implement \sa ITimestampBased template class ITimestampObjectList { - static_assert(std::is_base_of::value, "OBJ needs to implement ITimestampBased"); + static_assert(std::is_base_of_v, "OBJ needs to implement ITimestampBased"); public: //! Hint if the list is sorted @@ -451,7 +451,7 @@ namespace BlackMisc //! Such objects should implement \sa ITimestampWithOffsetBased template class ITimestampWithOffsetObjectList : public ITimestampObjectList { - static_assert(std::is_base_of::value, "OBJ needs to implement ITimestampBased"); + static_assert(std::is_base_of_v, "OBJ needs to implement ITimestampBased"); public: //! Hint if the list is sorted diff --git a/src/blackmisc/typetraits.h b/src/blackmisc/typetraits.h index 5ace19788..122fd89cc 100644 --- a/src/blackmisc/typetraits.h +++ b/src/blackmisc/typetraits.h @@ -37,7 +37,7 @@ namespace BlackMisc }; //! \private Dummy that derives from T if T is a class. - template ::value> + template > struct SyntheticDerived : public T {}; //! \cond template @@ -61,7 +61,7 @@ namespace BlackMisc struct TParameter { //! Whether the input parameter type T should be passed by value or by const reference. - static constexpr ParameterPassBy passBy = (sizeof(T) <= 16 && std::is_trivially_copy_constructible::value && std::is_trivially_destructible::value) ? ParameterPassBy::Value : ParameterPassBy::ConstRef; + static constexpr ParameterPassBy passBy = (sizeof(T) <= 16 && std::is_trivially_copy_constructible_v && std::is_trivially_destructible_v) ? ParameterPassBy::Value : ParameterPassBy::ConstRef; }; /*! diff --git a/src/blackmisc/variant.h b/src/blackmisc/variant.h index ffba8c687..da2416865 100644 --- a/src/blackmisc/variant.h +++ b/src/blackmisc/variant.h @@ -116,14 +116,14 @@ namespace BlackMisc //! Construct a variant from a value. template static CVariant fromValue(T &&value) { - static_assert(!std::is_same>::value, "CVariant is an illegal type!"); + static_assert(!std::is_same_v>, "CVariant is an illegal type!"); return CVariant(QVariant::fromValue(std::forward(value))); } //! Synonym for fromValue(). template static CVariant from(T &&value) { - static_assert(!std::is_same>::value, "CVariant is an illegal type!"); + static_assert(!std::is_same_v>, "CVariant is an illegal type!"); return CVariant(QVariant::fromValue(std::forward(value))); } diff --git a/src/blackmisc/variantprivate.h b/src/blackmisc/variantprivate.h index 5cf7d992d..e33807d3f 100644 --- a/src/blackmisc/variantprivate.h +++ b/src/blackmisc/variantprivate.h @@ -127,7 +127,7 @@ namespace BlackMisc static bool equalsPropertyByIndex(const T &object, const QVariant &, CPropertyIndexRef, ...) { throw CVariantException(object, "equalsPropertyByIndex"); } template - static int toIcon(const T &object, std::enable_if_t < ! std::is_same::value, decltype(static_cast(object.toIcon()), 0) >) { return object.toIcon(); } + static int toIcon(const T &object, std::enable_if_t < ! std::is_same_v, decltype(static_cast(object.toIcon()), 0) >) { return object.toIcon(); } template static int toIcon(const T &object, ...) { throw CVariantException(object, "toIcon"); } @@ -231,7 +231,7 @@ namespace BlackMisc IValueObjectMetaInfo *getValueObjectMetaInfo() { return getValueObjectMetaInfo(qMetaTypeId()); } //! \cond PRIVATE - template , T>::value && ! std::is_same::value>> + template , T> && ! std::is_same_v>> void maybeRegisterMetaListConvert(int); template void maybeRegisterMetaListConvert(...) {} diff --git a/src/blackmisc/worker.h b/src/blackmisc/worker.h index 037fab535..0c32ee7a5 100644 --- a/src/blackmisc/worker.h +++ b/src/blackmisc/worker.h @@ -256,9 +256,9 @@ namespace BlackMisc static CWorker *fromTaskImpl(QObject *owner, const QString &name, int typeId, const std::function &task); template - static auto fromResultOf(F &&func, std::enable_if_t::value, int>) { func(); return QVariant(); } + static auto fromResultOf(F &&func, std::enable_if_t, int>) { func(); return QVariant(); } template - static auto fromResultOf(F &&func, std::enable_if_t::value, int>) { return QVariant::fromValue(func()); } + static auto fromResultOf(F &&func, std::enable_if_t, int>) { return QVariant::fromValue(func()); } template R resultNoWait() { Q_ASSERT(m_result.canConvert()); return m_result.value(); } diff --git a/src/xswiftbus/menus.cpp b/src/xswiftbus/menus.cpp index bb342cde0..2267e9478 100644 --- a/src/xswiftbus/menus.cpp +++ b/src/xswiftbus/menus.cpp @@ -19,8 +19,8 @@ namespace XSwiftBus //! "safe" cast from integer to void* template void *voidptr_cast(T i) { - static_assert(std::is_integral::value, "voidptr_cast expects an integer"); - using intptr_type = std::conditional_t::value, intptr_t, uintptr_t>; + static_assert(std::is_integral_v, "voidptr_cast expects an integer"); + using intptr_type = std::conditional_t, intptr_t, uintptr_t>; return reinterpret_cast(static_cast(i)); } @@ -28,7 +28,7 @@ namespace XSwiftBus template T intptr_cast(void *p) { static_assert(std::is_integral::value, "voidptr_cast returns an integer"); - using intptr_type = std::conditional_t::value, intptr_t, uintptr_t>; + using intptr_type = std::conditional_t, intptr_t, uintptr_t>; return static_cast(reinterpret_cast(p)); }