@@ -148,15 +148,15 @@ namespace xsimd
148148#endif
149149
150150 template <class T , class Tp >
151- XSIMD_INLINE typename std::common_type <T, Tp>::type add (T const & x, Tp const & y) noexcept
151+ XSIMD_INLINE std::common_type_t <T, Tp> add (T const & x, Tp const & y) noexcept
152152 {
153153 return x + y;
154154 }
155155
156156 template <class T , class Tp >
157- XSIMD_INLINE typename std::common_type <T, Tp>::type avg (T const & x, Tp const & y) noexcept
157+ XSIMD_INLINE std::common_type_t <T, Tp> avg (T const & x, Tp const & y) noexcept
158158 {
159- using common_type = typename std::common_type <T, Tp>::type ;
159+ using common_type = std::common_type_t <T, Tp>;
160160 if (std::is_floating_point<common_type>::value)
161161 return (x + y) / 2 ;
162162 else if (std::is_unsigned<common_type>::value)
@@ -168,16 +168,16 @@ namespace xsimd
168168 // Inspired by
169169 // https://stackoverflow.com/questions/5697500/take-the-average-of-two-signed-numbers-in-c
170170 auto t = (x & y) + ((x ^ y) >> 1 );
171- auto t_u = static_cast <typename std::make_unsigned <common_type>::type >(t);
171+ auto t_u = static_cast <std::make_unsigned_t <common_type>>(t);
172172 auto avg = t + (static_cast <T>(t_u >> (8 * sizeof (T) - 1 )) & (x ^ y));
173173 return avg;
174174 }
175175 }
176176
177177 template <class T , class Tp >
178- XSIMD_INLINE typename std::common_type <T, Tp>::type avgr (T const & x, Tp const & y) noexcept
178+ XSIMD_INLINE std::common_type_t <T, Tp> avgr (T const & x, Tp const & y) noexcept
179179 {
180- using common_type = typename std::common_type <T, Tp>::type ;
180+ using common_type = std::common_type_t <T, Tp>;
181181 if (std::is_floating_point<common_type>::value)
182182 return avg (x, y);
183183 else
@@ -379,7 +379,7 @@ namespace xsimd
379379 }
380380
381381 template <class T , class Tp >
382- XSIMD_INLINE typename std::common_type <T, Tp>::type div (T const & x, Tp const & y) noexcept
382+ XSIMD_INLINE std::common_type_t <T, Tp> div (T const & x, Tp const & y) noexcept
383383 {
384384 return x / y;
385385 }
@@ -391,7 +391,7 @@ namespace xsimd
391391 }
392392
393393 template <class T , class Tp >
394- XSIMD_INLINE typename std::common_type <T, Tp>::type mul (T const & x, Tp const & y) noexcept
394+ XSIMD_INLINE std::common_type_t <T, Tp> mul (T const & x, Tp const & y) noexcept
395395 {
396396 return x * y;
397397 }
@@ -880,7 +880,7 @@ namespace xsimd
880880 }
881881
882882 template <class T , class Tp >
883- XSIMD_INLINE typename std::common_type <T, Tp>::type sub (T const & x, Tp const & y) noexcept
883+ XSIMD_INLINE std::common_type_t <T, Tp> sub (T const & x, Tp const & y) noexcept
884884 {
885885 return x - y;
886886 }
@@ -921,7 +921,7 @@ namespace xsimd
921921
922922 // numpy defines minimum operator on complex using lexical comparison
923923 template <class T0 , class T1 >
924- XSIMD_INLINE std::complex <typename std::common_type <T0, T1>::type >
924+ XSIMD_INLINE std::complex <std::common_type_t <T0, T1>>
925925 min (std::complex <T0> const & self, std::complex <T1> const & other) noexcept
926926 {
927927 return (self.real () < other.real ()) ? (self) : (self.real () == other.real () ? (self.imag () < other.imag () ? self : other) : other);
@@ -935,7 +935,7 @@ namespace xsimd
935935
936936 // numpy defines maximum operator on complex using lexical comparison
937937 template <class T0 , class T1 >
938- XSIMD_INLINE std::complex <typename std::common_type <T0, T1>::type >
938+ XSIMD_INLINE std::complex <std::common_type_t <T0, T1>>
939939 max (std::complex <T0> const & self, std::complex <T1> const & other) noexcept
940940 {
941941 return (self.real () > other.real ()) ? (self) : (self.real () == other.real () ? (self.imag () > other.imag () ? self : other) : other);
0 commit comments