I am using a fold expression to print elements in a variadic pack, but how do I get a space in between each element?
Currently the output is \"1 234\", the desired outpu
In general, you use recursion for tasks like this.
You have to define what happens when there are 2 or more and 1 elements in the list and recursively fall back to those definitions:
template struct List;
template struct List {
static void print() {
std::cout << First << " ";
List::print();
}
};
template struct List {
static void print() {
std::cout << Last;
}
};