This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <type_traits> | |
| // Determine if `Instance` is instantiation of template | |
| // e.g. static_assert(is_template<std::vector<int>>::value); | |
| template<class Instance> struct is_template : std::false_type {}; | |
| template<class ...TemplateArgs, template<class...> class Template> | |
| struct is_template<Template<TemplateArgs...>> : std::true_type {}; | |
| // Determine if `Instance` is instance of `Template` | |
| // e.g. static_assert(is_instance_of_template<std::vector, std::vector<int>>::value); |