Я экспериментировал с вариативными шаблонами С++ 0x, когда я наткнулся на эту проблему:
template < typename ...Args >
struct identities
{
typedef Args type; //compile error: "parameter packs not expanded with '...'
};
//The following code just shows an example of potential use, but has no relation
//with what I am actually trying to achieve.
template < typename T >
struct convert_in_tuple
{
typedef std::tuple< typename T::type... > type;
};
typedef convert_in_tuple< identities< int, float > >::type int_float_tuple;
GCC 4.5.0 дает мне ошибку при попытке typedef пакета параметров шаблона.
В принципе, я хотел бы "сохранить" пакет параметров в typedef, не распаковывая его. Является ли это возможным? Если нет, есть ли причина, почему это не разрешено?