diff --git a/src/corelib/global/q20type_traits.h b/src/corelib/global/q20type_traits.h index 2e812ed39c7..80ac1fa4313 100644 --- a/src/corelib/global/q20type_traits.h +++ b/src/corelib/global/q20type_traits.h @@ -38,6 +38,19 @@ using remove_cvref_t = std::remove_cv_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 +struct type_identity { using type = T; }; +template +using type_identity_t = typename type_identity::type; +#endif // __cpp_lib_type_identity +} + QT_END_NAMESPACE #endif /* Q20TYPE_TRAITS_H */