diff options
author | Nikolas Klauser <nikolasklauser@berlin.de> | 2022-09-06 00:33:34 +0200 |
---|---|---|
committer | Nikolas Klauser <nikolasklauser@berlin.de> | 2022-09-06 19:09:42 +0200 |
commit | 5fab33af7f083a0043112742027172e9f297c07f (patch) | |
tree | fdeddf314979f76bd49964c57880724b95799e17 /libcxx/include/__numeric | |
parent | 2fb68c0628e4e5d07c06164a42c0dd17f8ba16e7 (diff) | |
download | llvm-5fab33af7f083a0043112742027172e9f297c07f.zip llvm-5fab33af7f083a0043112742027172e9f297c07f.tar.gz llvm-5fab33af7f083a0043112742027172e9f297c07f.tar.bz2 |
[libc++] Avoid instantiating type_trait classes
Use `using` aliases to avoid instantiating lots of types
Reviewed By: ldionne, #libc
Spies: libcxx-commits, miyuki
Differential Revision: https://reviews.llvm.org/D132785
Diffstat (limited to 'libcxx/include/__numeric')
-rw-r--r-- | libcxx/include/__numeric/gcd_lcm.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/include/__numeric/gcd_lcm.h b/libcxx/include/__numeric/gcd_lcm.h index 9a53a00..b3d776b 100644 --- a/libcxx/include/__numeric/gcd_lcm.h +++ b/libcxx/include/__numeric/gcd_lcm.h @@ -60,8 +60,8 @@ common_type_t<_Tp,_Up> gcd(_Tp __m, _Up __n) { static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types"); - static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to gcd cannot be bool" ); - static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" ); + static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to gcd cannot be bool" ); + static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to gcd cannot be bool" ); using _Rp = common_type_t<_Tp,_Up>; using _Wp = make_unsigned_t<_Rp>; return static_cast<_Rp>(_VSTD::__gcd( @@ -75,8 +75,8 @@ common_type_t<_Tp,_Up> lcm(_Tp __m, _Up __n) { static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types"); - static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to lcm cannot be bool" ); - static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to lcm cannot be bool" ); + static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to lcm cannot be bool" ); + static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to lcm cannot be bool" ); if (__m == 0 || __n == 0) return 0; |