Short live q20::iter_reference_t

Another building block for QSpan.

Task-number: QTBUG-108124
Change-Id: Ic7205ec693d953f6b054282380e87e79dead8816
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-26 12:51:59 +02:00
parent 62801532a3
commit e86e275284

View File

@ -39,6 +39,16 @@ namespace q20 {
#endif
} // namespace q20
// like q20::iter_reference_t
namespace q20 {
#ifdef __cpp_lib_ranges
using std::iter_reference_t;
#else
template <typename Dereferencable> // unconstrained (constraint requires concepts)
using iter_reference_t = decltype(*std::declval<Dereferencable&>());
#endif // __cpp_lib_ranges
} // namespace q20
QT_END_NAMESPACE
#endif /* Q20ITERATOR_H */