В С++ 11 и/или С++ 1y:
Предположим, что мне задан шаблон с непараллельным пакетом параметров:
template<int...>
void f();
И я пишу еще один шаблон, который будет его создавать:
template<int... x>
void g()
{
???
f<???>();
}
Я хочу, чтобы g создавал экземпляр f с помощью x в отсортированном порядке.
То есть:
g<4,7,2,9,3,7>();
должен вызывать:
f<2,3,4,7,7,9>();
Можно ли это сделать? Если да, то какой наиболее эффективный способ (до постоянных факторов)?