我有一组像
这样的课程class A { void Do(int&); }
class B { void Do(char&); }
some more...
是否可以通过如下的可变参数模板连接这些类:
template <typename ...T>
class ConnectIt: public T...
{
using T ...::Do; // this expression fails.
// Some hints to get a set of using
// expressions from parameter pack?
};
实例化:
Class MyOne: public ConnectIt<A,B> {} my;
int i;
char c;
my.Do(i);
my.Do(c);