File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 9
9
#include < __hash_table>
10
10
#include < algorithm>
11
11
#include < stdexcept>
12
- #include < type_traits>
13
12
14
13
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED (" -Wtautological-constant-out-of-range-compare" )
15
14
@@ -52,16 +51,15 @@ const unsigned indices[] = {
52
51
// are fewer potential primes to search, and fewer potential primes to divide
53
52
// against.
54
53
55
- template <size_t _Sz = sizeof (size_t )>
56
- inline _LIBCPP_HIDE_FROM_ABI typename enable_if<_Sz == 4 , void >::type __check_for_overflow (size_t N) {
57
- if (N > 0xFFFFFFFB )
58
- std::__throw_overflow_error (" __next_prime overflow" );
59
- }
60
-
61
- template <size_t _Sz = sizeof (size_t )>
62
- inline _LIBCPP_HIDE_FROM_ABI typename enable_if<_Sz == 8 , void >::type __check_for_overflow (size_t N) {
63
- if (N > 0xFFFFFFFFFFFFFFC5ull )
64
- std::__throw_overflow_error (" __next_prime overflow" );
54
+ inline void __check_for_overflow (size_t N) {
55
+ if constexpr (sizeof (size_t ) == 4 ) {
56
+ if (N > 0xFFFFFFFB )
57
+ std::__throw_overflow_error (" __next_prime overflow" );
58
+ } else {
59
+ static_assert (sizeof (size_t ) == 8 );
60
+ if (N > 0xFFFFFFFFFFFFFFC5ull )
61
+ std::__throw_overflow_error (" __next_prime overflow" );
62
+ }
65
63
}
66
64
67
65
size_t __next_prime (size_t n) {
You can’t perform that action at this time.
0 commit comments