mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +08:00
Use _v traits variable aliases (C++17 feature)
This commit is contained in:
@@ -70,14 +70,14 @@ namespace BlackMisc
|
||||
const Derived *derived() const { return static_cast<const Derived *>(this); }
|
||||
Derived *derived() { return static_cast<Derived *>(this); }
|
||||
|
||||
template <typename T, std::enable_if_t<std::is_default_constructible<T>::value, int> = 0>
|
||||
template <typename T, std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
|
||||
QVariant myself() const { return QVariant::fromValue(*derived()); }
|
||||
template <typename T, std::enable_if_t<std::is_default_constructible<T>::value, int> = 0>
|
||||
template <typename T, std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
|
||||
void myself(const QVariant &variant) { *derived() = variant.value<T>(); }
|
||||
|
||||
template <typename T, std::enable_if_t<! std::is_default_constructible<T>::value, int> = 0>
|
||||
template <typename T, std::enable_if_t<! std::is_default_constructible_v<T>, int> = 0>
|
||||
QVariant myself() const { qFatal("isMyself should have been handled before reaching here"); return {}; }
|
||||
template <typename T, std::enable_if_t<! std::is_default_constructible<T>::value, int> = 0>
|
||||
template <typename T, std::enable_if_t<! std::is_default_constructible_v<T>, int> = 0>
|
||||
void myself(const QVariant &) { qFatal("isMyself should have been handled before reaching here"); }
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user