2016-07-06 42 views
1

可変長テンプレートパラメータを持つクラスの中で可変長テンプレートパラメータを持つクラスを特化するにはどうすればよいですか?私:可変長テンプレート内のC++特殊化可変長テンプレート

template < typename ... > 
struct test_class 
{ 
    template < typename ... > 
    struct s { }; 
}; 

template < > 
template < typename ... ts > 
struct test_class< ts ... >::s<int> { }; // doesn't work 

これも可能ですか?

答えて

2
template <typename...> 
struct OutsideS { 
    // ... 
}; 

template </* ... */> 
struct OutsideS</* ... */> { 
    // ... 
}; 

template <typename... Types> 
struct TestClass { 
    template <typename... OtherTypes> 
    using S = OutsideS<OtherTypes...>; 
}; 

ネストされた方法で特殊化することはできませんが、ネストされたテンプレートを別の場所に特殊化することができます。

関連する問題