Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

50 linhas
947 B

  1. #pragma once
  2. #include <cxxabi.h>
  3. #include <string>
  4. namespace cppcore
  5. {
  6. /**
  7. * @brief Class to get meta infos for a specific type.
  8. */
  9. template<typename T>
  10. struct type_helper
  11. {
  12. public:
  13. /**
  14. * @brief Get the name of the type.
  15. */
  16. static inline const std::string& name();
  17. };
  18. /**
  19. * @brief Implements a unique counter for the given template parameters.
  20. */
  21. template<typename...>
  22. struct unique_counter
  23. {
  24. /**
  25. * @brief Get the next value of the counter.
  26. */
  27. static inline size_t& next();
  28. };
  29. /**
  30. * @brief Get a unique ID for the passed template arguments.
  31. *
  32. * @tparam T_counter Counter to use to generate the unique ID.
  33. * @tparam X Type to generate the ID for.
  34. */
  35. template<typename T_counter, typename... X>
  36. inline size_t get_unique_id();
  37. }
  38. #include "type_helper.inl"