Код: Выделить всё
template
struct combine;
template
struct combine< Tpl, Tpl >
{
using type = Tpl;
};
template
struct pack_upto_impl;
// SPECIALIZATION 1
template
struct pack_upto_impl
{
using type = Tpl;
};
// SPECIALIZATION 2
template
struct pack_upto_impl
{
using remaining_type = typename pack_upto_impl::type;
using type = typename combine::type;
};
template
using pack_upto = pack_upto_impl;
Код: Выделить всё
using T = tuple;
pack_upto var1; // this is tuple
pack_upto var2; // this is tuple
pack_upto var3; // this is tuple
...
Какой самый элегантный способ добиться этой цели?
Подробнее здесь: https://stackoverflow.com/questions/740 ... -to-prefer