私の基本クラスのいくつかは、大量のパラメーターを取得します。次に、使用する静的関数を指定します。
template <typename... Types>
struct SBase {
static void func() {
}
};
struct A : public SBase<int> {
};
struct B : public A, public SBase<int, double, short,
unsigned int, float, unsigned char, long, unsigned long> {
// using SBase::func; // Not possible.
// Horrible, but works.
using SBase<int, double, short,
unsigned int, float, unsigned char, long, unsigned long>::func;
};
ご覧のとおり、テンプレートパラメータを2回記述する必要があるため、コードが重複します。
それを取り除く方法はありますか?