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>
This commit is contained in:
Marc Mutz 2023-05-23 15:44:20 +02:00
parent dcf7604230
commit 62801532a3

View File

@ -38,6 +38,19 @@ using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
#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
#endif /* Q20TYPE_TRAITS_H */