How to achieve want I want below? The paramater pack I want to unpack is not in a function argument list but template argument list.
#include <iostream>
#include <array>
const std::size_t SIZE = 10;
template <int...ARGS>
std::array<bool, SIZE> func() {
std::array<bool, SIZE> b;
// I want to set b[n] = true, where n takes on all values from ARGS...
// what to put in here???
return b;
}
// Example of what I want to achieve:
int main() {
const std::array<bool, SIZE> b = func<1,3,7>();
// I want b[1]==true, b[3]==true, b[7]==true, all others false
for (int x: b) std::cout << x << std::endl;
}
I have to use this form for func (instead of func(1,3,7)) to get my bigger program working (I'm dealing with multiple inheritance issues).