I stumbled upon an error, and I am unsure what is causing it. You can find the code here: https://godbolt.org/z/F9zdHg
#include <utility>
#define USE_PACK 1
#if USE_PACK == 1
template<int N, typename ...type_pack>
auto ap(type_pack...pack)
#else
template<int N>
auto ap()
#endif
{
auto sum = []<int ...Is>(std::index_sequence<Is...>) { return (Is + ...); };
return sum(std::make_index_sequence<N>{});
}
int main()
{
return ap<5>();
}
If you set USE_PACK 0
everything compiles fine, otherwise I get a strange error about the expansion of Is...
. Is this a compiler bug, or am I doing something wrong?