12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include "simple/support/meta/transform.hpp"
- #include "simple/support/meta/list.hpp"
- #include <type_traits>
- using namespace simple::support;
- template <typename T>
- using int_to_void_t = std::conditional_t<std::is_same_v<T, int>, void, T>;
- template <typename X, typename T>
- struct x_to_void { using type = std::conditional_t<std::is_same_v<T, X>, void, T>; };
- int main()
- {
- static_assert(std::is_same_v<
- meta::transform_t<meta::list<long, int, short, signed char>,
- std::make_unsigned_t>,
- meta::list<unsigned long, unsigned int, unsigned short, unsigned char>
- >);
- static_assert(std::is_same_v<
- meta::transform_t<meta::list<long, int, short, signed char>, int_to_void_t>,
- meta::list<long, void, short, signed char>
- >);
- static_assert(std::is_same_v<
- meta::transform_t<meta::list<long, int, short, signed char>, meta::bind_t<x_to_void, short>::template bound>,
- meta::list<long, int, void, signed char>
- >);
- static_assert(std::is_same_v<
- meta::transform_t<meta::list<long, int, short, signed char>, meta::bind_t<x_to_void, signed char>::template bound>,
- meta::list<long, int, short, void>
- >);
- return 0;
- }
|