c++ Unpacking parameter pack from template arguments
问题 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