3 ms·
You don't need recursion, but you do need a template, AFAIK. https://godbolt.org/z/o53o53W5r https://godbolt.org/z/o53o53W5r
by planede 3y ago
You don't need recursion, but you do need a template, AFAIK.
https://godbolt.org/z/o53o53W5r https://godbolt.org/z/o53o53W5r
- angiosperm 3y agoWhy does the <size_t ...Idxs> construct work, when we needed same_as<char>?
- planede 3y agoContext. I assume you mean something like `void foo(size_t ...Idxs)`, which indeed doesn't work. It can't work, as nothing indicates that this would be a template, and it should be at least templated on the size of the pack. <size_t ...Idxs> works because it introduces a pack that is a template parameter, so it naturally gets templated on the size of the pack (as well as on the values). I guess an other historical issue for the grammar is that without the parameter name, `void foo(size_t ...)` is already valid grammar, and is equivalent to `void foo(size_t, ...)`, a C-style variadic.