template.hpp 752 B

123456789101112131415161718192021222324252627
  1. #ifndef ENTT_META_TEMPLATE_HPP
  2. #define ENTT_META_TEMPLATE_HPP
  3. #include "../core/type_traits.hpp"
  4. namespace entt {
  5. /*! @brief Utility class to disambiguate class templates. */
  6. template<template<typename...> class>
  7. struct meta_class_template_tag {};
  8. /**
  9. * @brief General purpose traits class for generating meta template information.
  10. * @tparam Clazz Type of class template.
  11. * @tparam Args Types of template arguments.
  12. */
  13. template<template<typename...> class Clazz, typename... Args>
  14. struct meta_template_traits<Clazz<Args...>> {
  15. /*! @brief Wrapped class template. */
  16. using class_type = meta_class_template_tag<Clazz>;
  17. /*! @brief List of template arguments. */
  18. using args_type = type_list<Args...>;
  19. };
  20. } // namespace entt
  21. #endif