1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #include "simple/support/meta/pend.hpp"
- #include "simple/support/meta/list.hpp"
- #include <type_traits>
- using namespace simple::support;
- void Append()
- {
- static_assert( std::is_same_v<
- meta::append_t<meta::list<char, short>, int, long>,
- meta::list<char, short, int, long>>);
- static_assert( std::is_same_v<
- meta::append_t<meta::list<>, int, long>,
- meta::list<int, long>>);
- static_assert( std::is_same_v<
- meta::append_t<meta::list<char, short>, meta::list<>>,
- meta::list<char, short, meta::list<>>>);
- static_assert( std::is_same_v<
- meta::append_t<meta::list<>>,
- meta::list<>>);
- }
- void Prepend()
- {
- static_assert( std::is_same_v<
- meta::prepend_t<meta::list<char, short>, int, long>,
- meta::list<int, long, char, short>>);
- static_assert( std::is_same_v<
- meta::prepend_t<meta::list<>, int, long>,
- meta::list<int, long>>);
- static_assert( std::is_same_v<
- meta::prepend_t<meta::list<char, short>, meta::list<>>,
- meta::list<meta::list<>, char, short>>);
- static_assert( std::is_same_v<
- meta::prepend_t<meta::list<>>,
- meta::list<>>);
- }
- void Concat()
- {
- static_assert( std::is_same_v<
- meta::append_t<meta::list<char, short>, meta::list<int, long>>,
- meta::list<char, short, meta::list<int, long>>>);
- static_assert( std::is_same_v<
- meta::concat_t<meta::list<char, short>, meta::list<int, long>>,
- meta::list<char, short, int, long>>);
- static_assert( std::is_same_v<
- meta::concat_t<meta::list<>, meta::list<int, long>>,
- meta::list<int, long>>);
- static_assert( std::is_same_v<
- meta::concat_t<meta::list<char, short>, meta::list<>>,
- meta::list<char, short>>);
- static_assert( std::is_same_v<
- meta::concat_t<meta::list<>, meta::list<>>,
- meta::list<>>);
- }
- template <typename... T> class otherlist {};
- void Convert()
- {
- static_assert( std::is_same_v<
- meta::concat_t<otherlist<>, meta::list<char, short, int, long, long long>>,
- otherlist<char, short, int, long, long long>>);
- }
- int main()
- {
- Append();
- Prepend();
- Concat();
- Convert();
- return 0;
- }
|