File indexing completed on 2025-01-18 10:07:14
0001
0002
0003 #ifndef Q20ITERATOR_H
0004 #define Q20ITERATOR_H
0005
0006 #include <QtCore/qglobal.h>
0007
0008 #include <iterator>
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 QT_BEGIN_NAMESPACE
0027
0028
0029 namespace q20 {
0030 #ifdef __cpp_lib_ssize
0031 using std::ssize;
0032 #else
0033 template<class C> constexpr auto ssize(const C &c)
0034 -> std::common_type_t<std::ptrdiff_t, std::make_signed_t<decltype(c.size())>>
0035 { return static_cast<std::common_type_t<std::ptrdiff_t, std::make_signed_t<decltype(c.size())>>>(c.size()); }
0036
0037 template<class T, std::ptrdiff_t N> constexpr std::ptrdiff_t ssize(const T (&)[N]) noexcept
0038 { return N; }
0039 #endif
0040 }
0041
0042
0043 namespace q20 {
0044 #ifdef __cpp_lib_ranges
0045 using std::iter_reference_t;
0046 #else
0047 template <typename Dereferencable>
0048 using iter_reference_t = decltype(*std::declval<Dereferencable&>());
0049 #endif
0050 }
0051
0052 QT_END_NAMESPACE
0053
0054 #endif