traits: add is_same_template_template trait

This commit is contained in:
Danny Robson 2018-03-15 15:21:53 +11:00
parent cbe439b8e9
commit 5228cecbfb

View File

@ -352,4 +352,35 @@ struct inner_type<
template <typename ValueT> template <typename ValueT>
using inner_type_t = typename inner_type<ValueT>::type; using inner_type_t = typename inner_type<ValueT>::type;
///////////////////////////////////////////////////////////////////////////////
template <
template <typename...> class TemplateT,
typename QueryT
>
struct is_same_template_template : public std::false_type {};
//-----------------------------------------------------------------------------
template <
template <typename...> class TemplateT,
template <typename...> class QueryT,
typename ...Args
> struct is_same_template_template<
TemplateT,
QueryT<Args...>
> : public std::conditional_t<
std::is_same_v<
TemplateT<Args...>,
QueryT<Args...>
>,
std::true_type,
std::false_type
> { };
//-----------------------------------------------------------------------------
template <template <typename...> class TemplateT, typename QueryT>
constexpr auto is_same_template_template_v = is_same_template_template<TemplateT,QueryT>::value;
#endif #endif