使用我知道下面的代碼編譯:與可變參數模板
template<class Type>
class Foo
{
using type = Type;
};
現在
,我試圖編譯下面的代碼:
template<class Type, class... OtherTypes>
class Foo
{
using type = Type;
// using types = OtherTypes;
// using... types = OtherTypes;
// using types... = OtherTypes;
// using types = OtherTypes...;
// using types... = OtherTypes...;
};
我嘗試了所有的代碼的選項在評論中,但他們都沒有編譯。 我該如何解決它?
你不能。但取決於使用你可以得到替代結構 – bolov
我需要從Foo獲得可變類。就像'Foo :: OtherTypes' –
會像'using types_tuple = std :: tuple'就足夠了嗎? –
Caleth