25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
853 B

  1. #include <cpputils/mp/misc/tag_of.h>
  2. namespace test_mp_util_tag_of
  3. {
  4. struct tagged_int { using tag = int; };
  5. struct tagged_float { using tag = float; };
  6. struct tagged_not { };
  7. }
  8. using namespace ::utl::mp;
  9. using namespace ::test_mp_util_tag_of;
  10. using tagged_0_expected = int;
  11. using tagged_0_actual = tag_of<tagged_int>;
  12. static_assert(is_same<tagged_0_expected, tagged_0_actual>::value, "");
  13. using tagged_1_expected = float;
  14. using tagged_1_actual = tag_of<tagged_float>;
  15. static_assert(is_same<tagged_1_expected, tagged_1_actual>::value, "");
  16. using not_tagged_expected = tagged_not;
  17. using not_tagged_actual = tag_of<tagged_not>;
  18. static_assert(is_same<not_tagged_expected, not_tagged_actual>::value, "");
  19. using bool_expected = bool;
  20. using bool_actual = tag_of<bool>;
  21. static_assert(is_same<bool_expected, bool_actual>::value, "");