How do I check if a template type is a template itself?

Good Afternoon,

Is it possible to perform a check on a template type to determine if it is a template itself? I was looking for something like is_template in type_traits but couldn't find it.

1
2
3
4
template<typename T>
class Something {
// need to know if T is a template class itself...???
};

Thank you for any assistance that is offered.
Kind Regards,
Phil.
Something like this:

1
2
3
4
5
6
7
8
9
10
template < typename X > struct is_template : std::false_type {} ;

template < template <typename...> class X, typename... P >
struct is_template< X<P...> > : std::true_type {} ;

template < typename T > class Something
{
    public: static constexpr bool is_template_type = is_template<T>::value ;
    // ...
};
Thank you - that worked perfectly, Merry Christmas! :-)
Topic archived. No new replies allowed.