Commit ce02416
committed
QRM: specialize row_traits for std::array
std::tuple_element is implemented for std::array, so we end up using the
tuple specialization of row_traits for a QRangeModel(std::array<T, N>).
This is semantically wrong, but it also breaks the build when using a
large array.
The tuple specialization uses a helper to test if all elements in the
tuple have the same type. With large arrays, this hits the compiler's
limit for fold-expressions, which defaults with clang to 256.
Specialize row_traits for std::array as well as C arrays; we know that
all elements are of the same type. To avoid ambiguity,
don't consider a std::array as a tuple. Introduce a
array_like detector that is true for std::array and C arrays of any type
and overload for_element_at using that detector (we have to, as we need
the array as a universal reference).
For the same reason, avoid the fold expression in meta_type_at if the
row type is an array. All types are the same anyway, so we can just
pick the first.
Pick-to: 6.10
Change-Id: Ic49e222d7b3390f9e4cc15ec531f8a97981ab0d5
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>1 parent c8a1e7b commit ce02416
File tree
3 files changed
+73
-10
lines changed- src/corelib/itemmodels
- tests
- auto/corelib/itemmodels/qrangemodel
- manual/corelib/itemmodels/qrangemodel
3 files changed
+73
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
305 | 307 | | |
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
309 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
310 | 321 | | |
311 | 322 | | |
312 | 323 | | |
| |||
556 | 567 | | |
557 | 568 | | |
558 | 569 | | |
559 | | - | |
| 570 | + | |
560 | 571 | | |
561 | | - | |
| 572 | + | |
562 | 573 | | |
563 | 574 | | |
564 | 575 | | |
| |||
567 | 578 | | |
568 | 579 | | |
569 | 580 | | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
570 | 584 | | |
571 | 585 | | |
572 | 586 | | |
| |||
794 | 808 | | |
795 | 809 | | |
796 | 810 | | |
797 | | - | |
798 | | - | |
799 | | - | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
800 | 815 | | |
| 816 | + | |
801 | 817 | | |
802 | 818 | | |
803 | 819 | | |
804 | 820 | | |
805 | 821 | | |
806 | 822 | | |
807 | | - | |
808 | | - | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
809 | 826 | | |
810 | 827 | | |
811 | 828 | | |
| |||
814 | 831 | | |
815 | 832 | | |
816 | 833 | | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
817 | 842 | | |
818 | 843 | | |
819 | 844 | | |
| |||
825 | 850 | | |
826 | 851 | | |
827 | 852 | | |
828 | | - | |
829 | | - | |
830 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
831 | 861 | | |
832 | 862 | | |
833 | 863 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
1137 | 1138 | | |
1138 | 1139 | | |
1139 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
1140 | 1166 | | |
1141 | 1167 | | |
1142 | 1168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
| |||
0 commit comments