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