@@ -43,9 +43,11 @@ template<std::size_t I> struct W
43
43
44
44
template <class N > using Wf = W< N::value >;
45
45
46
- template <template <class ...> class F , std:: size_t N > void test_ ()
46
+ template <class L , template <class ...> class F > void test ()
47
47
{
48
- using V = mp_rename< mp_transform<F, mp_iota_c<N>>, boost::variant2::variant >;
48
+ using V = mp_rename< mp_transform<F, L>, boost::variant2::variant >;
49
+
50
+ constexpr std::size_t N = mp_size<L>::value;
49
51
50
52
using last_type = F<mp_size_t <N-1 >>;
51
53
@@ -63,32 +65,22 @@ template<template<class...> class F, std::size_t N> void test_()
63
65
}
64
66
}
65
67
66
- template <template <class ...> class F > void test ()
67
- {
68
- test_<F, 126 >();
69
- test_<F, 127 >();
70
- test_<F, 128 >();
71
- test_<F, 129 >();
72
-
73
- test_<F, 254 >();
74
- test_<F, 255 >();
75
- test_<F, 256 >();
76
- test_<F, 257 >();
77
- }
78
-
79
68
int main ()
80
69
{
70
+ constexpr std::size_t N = LIST_SIZE;
71
+ using L = mp_iota_c<N>;
72
+
81
73
static_assert ( !boost::variant2::variant< X<0 >, X<1 > >::uses_double_storage (), " " );
82
- test<Xf>();
74
+ test<L, Xf>();
83
75
84
76
static_assert ( boost::variant2::variant< Y<0 >, Y<1 > >::uses_double_storage (), " " );
85
- test<Yf>();
77
+ test<L, Yf>();
86
78
87
79
static_assert ( !boost::variant2::variant< Z<0 >, Z<1 > >::uses_double_storage (), " " );
88
- test<Zf>();
80
+ test<L, Zf>();
89
81
90
82
static_assert ( boost::variant2::variant< W<0 >, W<1 > >::uses_double_storage (), " " );
91
- test<Wf>();
83
+ test<L, Wf>();
92
84
93
85
return boost::report_errors ();
94
86
}
0 commit comments