mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 04:14:27 +02:00
refactor: has_common_type_v
simplified
This commit is contained in:
@@ -30,17 +30,8 @@
|
||||
|
||||
namespace mp_units::detail {
|
||||
|
||||
template<typename AlwaysVoid, typename... Ts>
|
||||
struct has_common_type_impl : std::false_type {};
|
||||
|
||||
template<typename... Ts>
|
||||
struct has_common_type_impl<std::void_t<std::common_type_t<Ts...>>, Ts...> : std::true_type {};
|
||||
|
||||
template<typename... Ts>
|
||||
using has_common_type = typename has_common_type_impl<void, Ts...>::type;
|
||||
|
||||
template<typename... Ts>
|
||||
constexpr bool has_common_type_v = has_common_type_impl<void, Ts...>::value;
|
||||
constexpr bool has_common_type_v = requires { typename std::common_type_t<Ts...>; };
|
||||
|
||||
template<typename T, typename Other>
|
||||
using maybe_common_type =
|
||||
|
Reference in New Issue
Block a user