You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
713 B

  1. #pragma once
  2. #include <cpputils/mp/misc/to.h>
  3. #include <cpputils/mp/misc/make.h>
  4. #include <cpputils/mp/container/basic_tuple.h>
  5. namespace utl {
  6. namespace mp {
  7. struct tag_map { };
  8. constexpr auto make_map = make<tag_map>;
  9. constexpr auto to_map = make<tag_map>;
  10. namespace __impl /* forward declaration */
  11. {
  12. template<typename... Pairs>
  13. struct make_map_type;
  14. }
  15. template<typename... Pairs>
  16. using map = typename __impl::make_map_type<Pairs...>::type;
  17. namespace __impl /* implementation */
  18. {
  19. template<typename... Pairs>
  20. struct make_map_type
  21. {
  22. using storage_type = basic_tuple<Pairs...>;
  23. };
  24. }
  25. }
  26. }