Short live q20::type_identity
Trivial implementation. No test necessary. Task-number: QTBUG-108124 Change-Id: I20ec14e49f4db6399502f953b569c889d30bb5a7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 62801532a33ab11d9bce42340c50619d49a7d0c8) Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
79f7000099
commit
da4820419e
@ -38,6 +38,19 @@ using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
|
|||||||
#endif // __cpp_lib_remove_cvref
|
#endif // __cpp_lib_remove_cvref
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace q20 {
|
||||||
|
// like std::type_identity(_t)
|
||||||
|
#ifdef __cpp_lib_type_identity
|
||||||
|
using std::type_identity;
|
||||||
|
using std::type_identity_t;
|
||||||
|
#else
|
||||||
|
template <typename T>
|
||||||
|
struct type_identity { using type = T; };
|
||||||
|
template <typename T>
|
||||||
|
using type_identity_t = typename type_identity<T>::type;
|
||||||
|
#endif // __cpp_lib_type_identity
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif /* Q20TYPE_TRAITS_H */
|
#endif /* Q20TYPE_TRAITS_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user