type_helper.h 535 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <type_traits>
  3. template<typename... _Elements>
  4. struct __reflection_typelist;
  5. /// Specialization for an empty typelist.
  6. template<>
  7. struct __reflection_typelist<>
  8. {
  9. typedef std::true_type empty;
  10. };
  11. /// Partial specialization.
  12. template<typename _First, typename... _Rest>
  13. struct __reflection_typelist<_First, _Rest...>
  14. {
  15. typedef std::false_type empty;
  16. struct first
  17. {
  18. typedef _First type;
  19. };
  20. struct rest
  21. {
  22. typedef __reflection_typelist<_Rest...> type;
  23. };
  24. };