@@ -29,7 +29,7 @@ namespace xsimd
2929 template <class A , class T , class >
3030 XSIMD_INLINE batch<T, A> abs (batch<T, A> const & self, requires_arch<common>) noexcept
3131 {
32- if (std::is_unsigned <T>::value )
32+ if (std::is_unsigned_v <T>)
3333 return self;
3434 else
3535 {
@@ -85,7 +85,7 @@ namespace xsimd
8585 XSIMD_INLINE batch<T, A> avgr (batch<T, A> const & x, batch<T, A> const & y, std::true_type) noexcept
8686 {
8787 constexpr unsigned shift = 8 * sizeof (T) - 1 ;
88- auto adj = std::is_signed <T>::value ? ((x ^ y) & 0x1 ) : (((x ^ y) << shift) >> shift);
88+ auto adj = std::is_signed_v <T> ? ((x ^ y) & 0x1 ) : (((x ^ y) << shift) >> shift);
8989 return ::xsimd::kernel::avg (x, y, A {}) + adj;
9090 }
9191
@@ -124,7 +124,7 @@ namespace xsimd
124124 template <class A , class T_out , class T_in >
125125 XSIMD_INLINE batch<T_out, A> batch_cast (batch<T_in, A> const & self, batch<T_out, A> const &, requires_arch<common>, with_slow_conversion) noexcept
126126 {
127- static_assert (!std::is_same <T_in, T_out>::value , " there should be no conversion for this type combination" );
127+ static_assert (!std::is_same_v <T_in, T_out>, " there should be no conversion for this type combination" );
128128 using batch_type_in = batch<T_in, A>;
129129 using batch_type_out = batch<T_out, A>;
130130 static_assert (batch_type_in::size == batch_type_out::size, " compatible sizes" );
@@ -148,8 +148,8 @@ namespace xsimd
148148 template <class A , class T >
149149 XSIMD_INLINE batch<T, A> bitofsign (batch<T, A> const & self, requires_arch<common>) noexcept
150150 {
151- static_assert (std::is_integral <T>::value , " int type implementation" );
152- if (std::is_unsigned <T>::value )
151+ static_assert (std::is_integral_v <T>, " int type implementation" );
152+ if (std::is_unsigned_v <T>)
153153 return batch<T, A>(0 );
154154 else
155155 return self >> (T)(8 * sizeof (T) - 1 );
@@ -286,7 +286,7 @@ namespace xsimd
286286 }
287287
288288 // copysign
289- template <class A , class T , class = std::enable_if_t <std::is_floating_point <T>::value >>
289+ template <class A , class T , class = std::enable_if_t <std::is_floating_point_v <T>>>
290290 XSIMD_INLINE batch<T, A> copysign (batch<T, A> const & self, batch<T, A> const & other, requires_arch<common>) noexcept
291291 {
292292 return abs (self) | bitofsign (other);
@@ -1899,7 +1899,7 @@ namespace xsimd
18991899 }
19001900
19011901 // mod
1902- template <class A , class T , class = std::enable_if_t <std::is_integral <T>::value >>
1902+ template <class A , class T , class = std::enable_if_t <std::is_integral_v <T>>>
19031903 XSIMD_INLINE batch<T, A> mod (batch<T, A> const & self, batch<T, A> const & other, requires_arch<common>) noexcept
19041904 {
19051905 return detail::apply ([](T x, T y) noexcept -> T
@@ -1908,7 +1908,7 @@ namespace xsimd
19081908 }
19091909
19101910 // nearbyint
1911- template <class A , class T , class = std::enable_if_t <std::is_integral <T>::value >>
1911+ template <class A , class T , class = std::enable_if_t <std::is_integral_v <T>>>
19121912 XSIMD_INLINE batch<T, A> nearbyint (batch<T, A> const & self, requires_arch<common>) noexcept
19131913 {
19141914 return self;
@@ -1940,7 +1940,7 @@ namespace xsimd
19401940 }
19411941
19421942 // nearbyint_as_int
1943- template <class T , class A , class = std::enable_if_t <std::is_integral <T>::value >>
1943+ template <class T , class A , class = std::enable_if_t <std::is_integral_v <T>>>
19441944 XSIMD_INLINE batch<T, A> nearbyint_as_int (batch<T, A> const & self, requires_arch<common>) noexcept
19451945 {
19461946 return self;
@@ -1970,7 +1970,7 @@ namespace xsimd
19701970 // nextafter
19711971 namespace detail
19721972 {
1973- template <class T , class A , bool is_int = std::is_integral <T>::value >
1973+ template <class T , class A , bool is_int = std::is_integral_v <T>>
19741974 struct nextafter_kernel
19751975 {
19761976 using batch_type = batch<T, A>;
@@ -2102,7 +2102,7 @@ namespace xsimd
21022102 }
21032103
21042104 // reciprocal
2105- template <class T , class A , class = std::enable_if_t <std::is_floating_point <T>::value >>
2105+ template <class T , class A , class = std::enable_if_t <std::is_floating_point_v <T>>>
21062106 XSIMD_INLINE batch<T, A> reciprocal (batch<T, A> const & self,
21072107 requires_arch<common>) noexcept
21082108 {
@@ -2217,7 +2217,7 @@ namespace xsimd
22172217 detail::reassociation_barrier (q, " prevent pulling multiply back through rounded quotient" );
22182218 return fnma (q, other, self);
22192219 }
2220- template <class A , class T , class = std::enable_if_t <std::is_integral <T>::value >>
2220+ template <class A , class T , class = std::enable_if_t <std::is_integral_v <T>>>
22212221 XSIMD_INLINE batch<T, A> remainder (batch<T, A> const & self, batch<T, A> const & other, requires_arch<common>) noexcept
22222222 {
22232223 auto mod = self % other;
@@ -2232,7 +2232,7 @@ namespace xsimd
22322232 }
22332233
22342234 // sign
2235- template <class A , class T , class = std::enable_if_t <std::is_integral <T>::value >>
2235+ template <class A , class T , class = std::enable_if_t <std::is_integral_v <T>>>
22362236 XSIMD_INLINE batch<T, A> sign (batch<T, A> const & self, requires_arch<common>) noexcept
22372237 {
22382238 using batch_type = batch<T, A>;
@@ -2278,7 +2278,7 @@ namespace xsimd
22782278 }
22792279
22802280 // signnz
2281- template <class A , class T , class = std::enable_if_t <std::is_integral <T>::value >>
2281+ template <class A , class T , class = std::enable_if_t <std::is_integral_v <T>>>
22822282 XSIMD_INLINE batch<T, A> signnz (batch<T, A> const & self, requires_arch<common>) noexcept
22832283 {
22842284 using batch_type = batch<T, A>;
@@ -2315,8 +2315,8 @@ namespace xsimd
23152315 XSIMD_INLINE batch<std::complex <T>, A> sqrt (batch<std::complex <T>, A> const & z, requires_arch<common>) noexcept
23162316 {
23172317
2318- constexpr T csqrt_scale_factor = std::is_same <T, float >::value ? 6 .7108864e7f : 1.8014398509481984e16 ;
2319- constexpr T csqrt_scale = std::is_same <T, float >::value ? 1 .220703125e-4f : 7.450580596923828125e-9 ;
2318+ constexpr T csqrt_scale_factor = std::is_same_v <T, float > ? 6 .7108864e7f : 1.8014398509481984e16 ;
2319+ constexpr T csqrt_scale = std::is_same_v <T, float > ? 1 .220703125e-4f : 7.450580596923828125e-9 ;
23202320 using batch_type = batch<std::complex <T>, A>;
23212321 using real_batch = batch<T, A>;
23222322 real_batch x = z.real ();
0 commit comments