meta_reconstruct.cpp 672 B

1234567891011121314151617181920212223242526
  1. #include "simple/support/meta/reconstruct.hpp"
  2. #include "simple/support/meta/list.hpp"
  3. #include <type_traits>
  4. using namespace simple::support;
  5. template <typename T>
  6. struct double_float { using type = meta::list<T>; };
  7. template <> struct double_float<double> { using type = meta::list<float, float>; };
  8. int main()
  9. {
  10. static_assert(std::is_same_v<
  11. meta::reconstruct_t<meta::list<int, double, char>, double_float>,
  12. meta::list<int, float, float, char>
  13. >);
  14. static_assert(std::is_same_v<
  15. meta::reconstruct_t<meta::list<double, meta::list<int, double, char>, bool>,
  16. double_float>,
  17. meta::list<float, float, meta::list<int, double, char>, bool>
  18. >);
  19. return 0;
  20. }