File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -791,10 +791,11 @@ class shape {
791
791
private:
792
792
dims_type dims_;
793
793
794
- // TODO: This should use std::is_constructible<dims_type, std::tuple<OtherDims...>>
795
- // but it is broken on some compilers (https://github.com/dsharlet/array/issues/20).
794
+ // This uses std::is_assignable because std::is_constructible is broken
795
+ // on some C++ STLs (https://github.com/dsharlet/array/issues/20).
796
796
template <class ... OtherDims>
797
- using enable_if_dims_compatible = typename std::enable_if<sizeof ...(OtherDims) == rank()>::type;
797
+ using enable_if_dims_compatible = typename std::enable_if<
798
+ std::is_assignable<dims_type, std::tuple<OtherDims...>>::value>::type;
798
799
799
800
template <class ... Args>
800
801
using enable_if_same_rank = typename std::enable_if<(sizeof ...(Args) == rank())>::type;
Original file line number Diff line number Diff line change @@ -70,11 +70,10 @@ void shape_shape_too_many_dims() {
70
70
shape<dim<>> s2 (0 , 1 );
71
71
}
72
72
73
- // TODO: This builds due to https://github.com/dsharlet/array/issues/20
74
- // void shape_shape_incompatible() {
75
- // shape<dim<dynamic, dynamic, 4>> s2;
76
- // shape<dense_dim<>> s3(s2);
77
- // }
73
+ void shape_shape_incompatible () {
74
+ shape<dim<1 , 2 , 3 >> s2;
75
+ shape<dim<4 , 5 , 6 >> s3 (s2);
76
+ }
78
77
79
78
void shape_at_too_many_indices () {
80
79
s (0 , 1 , 2 );
You can’t perform that action at this time.
0 commit comments