meta_integer_sequence.cpp 806 B

12345678910111213141516171819202122232425
  1. #include "simple/support/meta/integer_sequence.hpp"
  2. using namespace simple::support;
  3. template <int... Is>
  4. using iseq = std::integer_sequence<int, Is...>;
  5. int main()
  6. {
  7. using a = std::index_sequence<1, 2, 3, 4>;
  8. static_assert(std::is_same_v<meta::offset_sequence_t<a, -1>, std::index_sequence<0,1,2,3>>);
  9. static_assert(std::is_same_v<meta::offset_sequence_t<a, 10>, std::index_sequence<11,12,13,14>>);
  10. static_assert(std::is_same_v<meta::make_index_range<3, 7>, std::index_sequence<3,4,5,6>>);
  11. static_assert(std::is_same_v<meta::make_index_segment<13, 3>, std::index_sequence<13,14,15>>);
  12. static_assert(std::is_same_v<
  13. meta::concat_sequence_t<iseq<1,2>, iseq<3,4,5>>,
  14. iseq<1,2,3,4,5>>);
  15. static_assert(std::is_same_v<
  16. meta::offset_sequence_t<iseq<1,2,3>, -3>,
  17. iseq<-2,-1,0>>);
  18. return 0;
  19. }