11
11
12
12
#include < flux.hpp>
13
13
14
- // GCC 11 doesn't support constexpr std::vector
15
- #if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 12
16
- #define COMPILER_IS_GCC11
17
- #endif
18
-
19
14
// std::abs is not constexpr in C++20
20
15
auto const c_abs = [](std::signed_integral auto i) { return i < 0 ? -i : i; };
21
16
@@ -31,11 +26,9 @@ auto const max_gap_count = [](std::vector<int> nums)
31
26
return diffs.count_eq (diffs.max ().value_or (0 ));
32
27
};
33
28
34
- #ifndef COMPILER_IS_GCC11
35
29
static_assert (max_gap_count({2 , 5 , 8 , 1 }) == 2 );
36
30
static_assert (max_gap_count({3 , 6 , 9 , 1 }) == 2 );
37
31
static_assert (max_gap_count({10 }) == 0 );
38
- #endif
39
32
40
33
}
41
34
@@ -63,27 +56,11 @@ auto const max_gap_count = [](std::vector<int> nums)
63
56
.count ;
64
57
};
65
58
66
- #ifndef COMPILER_IS_GCC11
67
59
static_assert (max_gap_count({2 , 5 , 8 , 1 }) == 2 );
68
60
static_assert (max_gap_count({3 , 6 , 9 , 1 }) == 2 );
69
61
static_assert (max_gap_count({10 }) == 0 );
70
- #endif
71
62
72
63
}
73
64
74
65
int main ()
75
- {
76
- {
77
- using namespace version1 ;
78
- FLUX_ASSERT (max_gap_count ({2 , 5 , 8 , 1 }) == 2 );
79
- FLUX_ASSERT (max_gap_count ({3 , 6 , 9 , 1 }) == 2 );
80
- FLUX_ASSERT (max_gap_count ({10 }) == 0 );
81
- }
82
-
83
- {
84
- using namespace version2 ;
85
- FLUX_ASSERT (max_gap_count ({2 , 5 , 8 , 1 }) == 2 );
86
- FLUX_ASSERT (max_gap_count ({3 , 6 , 9 , 1 }) == 2 );
87
- FLUX_ASSERT (max_gap_count ({10 }) == 0 );
88
- }
89
- }
66
+ {}
0 commit comments