Answers here and here are pretty much what I need. However, I would like to be able to generate sequences such as:
gen_seq<5, 2> // {0, 1, 3, 4}
gen_seq<3, 0> // {1, 2}
// optional behavior that would be useful for me:
gen_seq<4, 4> // {0, 1, 2, 3}
In the examples I used gen_seq to generate a sequence from 0 to N-1 without I. This is not mandatory, I would also be fine with gen_seq where N is the length of the sequence and I the missing index or other variants.
I think most of the problem is already answered in the linked questions. However I cannot really wrap my head around how to incorporate the "leave this one out" condition for the second parameter.
Ideally, I would love to stick to c++11 features and avoid c++14. Elegant and especially readable soulutions using c++14 could also be very interesting, though.