Код: Выделить всё
#include
// those structs cannot be changed
struct Foo1 {int f;};
struct Foo2 {int g;};
struct Foo3 {int h;};
void processFoo(Foo1 &foo)
{
}
void processFoo(Foo2 &foo)
{
}
void processFoo(Foo3 &foo)
{
}
bool selectFoo2()
{
// known at run time
return true;
}
bool selectFoo3()
{
// known at run time
return false;
}
template
void save(const FooT &...foos)
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79699195/dynamic-list-of-arguments-for-a-variadic-function[/url]