Templa 0.0.1-alpha
C++ Metaprogramming Utilities
Loading...
Searching...
No Matches
templa::concepts::is_specialization_of Concept Reference

Checks whether a given type T is a specialization of the class template Template. More...

#include <concepts.hpp>

Concept definition

template<class T, template< typename... > class Template>
concept templa::concepts::is_specialization_of = requires(T const &t) {
[]<typename... Args>(Template<Args...> const &)
{ return true; }(t);
}
Checks whether a given type T is a specialization of the class template Template.
Definition concepts.hpp:286

Detailed Description

Checks whether a given type T is a specialization of the class template Template.

This concept is satisfied if T is an instantiation of Template with any number of template arguments.

Example

template <typename...>
struct my_template {};
static_assert(is_specialization_of<my_template<int>, my_template>);
Template Parameters
TThe type to check.
TemplateThe class template to check against (e.g., std::tuple, std::vector).