mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-05 13:14:29 +02:00
refactor: simplify is_specialization_of
This commit is contained in:
committed by
Mateusz Pusz
parent
db041061e0
commit
e30aa9c4a0
11
src/include/units/bits/external/type_traits.h
vendored
11
src/include/units/bits/external/type_traits.h
vendored
@@ -59,18 +59,11 @@ template<class T, class U>
|
|||||||
using is_same = std::bool_constant<is_same_v<T, U>>;
|
using is_same = std::bool_constant<is_same_v<T, U>>;
|
||||||
|
|
||||||
// is_specialization_of
|
// is_specialization_of
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
template<typename T, template<typename...> typename Type>
|
template<typename T, template<typename...> typename Type>
|
||||||
inline constexpr bool is_specialization_of_impl = false;
|
inline constexpr bool is_specialization_of = false;
|
||||||
|
|
||||||
template<typename... Params, template<typename...> typename Type>
|
template<typename... Params, template<typename...> typename Type>
|
||||||
inline constexpr bool is_specialization_of_impl<Type<Params...>, Type> = true;
|
inline constexpr bool is_specialization_of<Type<Params...>, Type> = true;
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
template<typename T, template<typename...> typename Type>
|
|
||||||
inline constexpr bool is_specialization_of = detail::is_specialization_of_impl<T, Type>;
|
|
||||||
|
|
||||||
// is_derived_from_specialization_of
|
// is_derived_from_specialization_of
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
Reference in New Issue
Block a user