3
他のテンプレートパラメータを持つ独自のクラステンプレートをフレンドとして宣言できますか?他のテンプレートパラメータを持つ自分のクラステンプレートを持つフレンド
template<class T, class... Ts>
class A {
template<class U> friend class A<U, Ts...>; //compile error - C3772 'A<U>': invalid friend template declaration
};
問題:あなたは本当にすべて
U
特殊化を仲良くする必要がある場合は、テンプレート全体を仲良くする必要があります。私は、Aの最初のパラメータを異なるものにしたいだけです。それも可能ですか? – Philinator@Philinator私はそれが現在の標準では不可能だと確信しています。 – xinaiz